File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ jobs:
1111 steps :
1212
1313 - name : Set up Go 1.x
14- uses : actions/setup-go@v2
14+ uses : actions/setup-go@v5
1515 with :
1616 go-version : ^1.20
1717 id : go
1818
1919 - name : Check out code into the Go module directory
20- uses : actions/checkout@v2
20+ uses : actions/checkout@v5
2121
2222 - name : Build commands
2323 run : .github/build-all
2626 run : sudo go test -v -coverprofile coverage.txt ./...
2727
2828 - name : Upload coverage report
29- uses : codecov/codecov-action@v1
29+ uses : codecov/codecov-action@v5
3030 with :
31- file : coverage.txt
31+ files : coverage.txt
Original file line number Diff line number Diff line change 99 name : lint
1010 runs-on : ubuntu-latest
1111 steps :
12- - uses : actions/checkout@v3
13- - uses : actions/setup-go@v3
12+ - uses : actions/checkout@v5
13+ - uses : actions/setup-go@v5
1414 with :
1515 go-version : ^1.20
1616 - name : golangci-lint
17- uses : golangci/golangci-lint-action@v3
17+ uses : golangci/golangci-lint-action@v8
1818 with :
19- version : v1.51
19+ version : v2.4.0
Original file line number Diff line number Diff line change 1- issues :
2- # Excluding configuration per-path, per-linter, per-text and per-source
3- exclude-rules :
4- # Exclude some linters from running on tests files.
5- - path : \.go
6- linters :
7- - errcheck
1+ version : " 2"
2+ linters :
3+ exclusions :
4+ generated : lax
5+ presets :
6+ - comments
7+ - common-false-positives
8+ - legacy
9+ - std-error-handling
10+ rules :
11+ - linters :
12+ - errcheck
13+ path : \.go
14+ paths :
15+ - third_party$
16+ - builtin$
17+ - examples$
18+ formatters :
19+ exclusions :
20+ generated : lax
21+ paths :
22+ - third_party$
23+ - builtin$
24+ - examples$
Original file line number Diff line number Diff line change @@ -92,7 +92,8 @@ func (s *history) compute() (st stat) {
9292
9393 stddevNum := float64 (0 )
9494 for _ , rtt := range collection {
95- stddevNum += math .Pow (float64 (rtt - st .mean ), 2 )
95+ dev := float64 (rtt - st .mean )
96+ stddevNum += dev * dev
9697 }
9798 st .stddev = time .Duration (math .Sqrt (stddevNum / float64 (size )))
9899
Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ func (h *History) compute() *Metrics {
100100 size := float64 (numTotal - numFailure )
101101 mean = total / size
102102 for _ , rtt := range data {
103- sumSquares += math .Pow (rtt - mean , 2 )
103+ diff := rtt - mean
104+ sumSquares += diff * diff
104105 }
105106 stddev = math .Sqrt (sumSquares / size )
106107
You can’t perform that action at this time.
0 commit comments