Skip to content

Commit e4a9971

Browse files
committed
Fix CI
1 parent 6852e0f commit e4a9971

5 files changed

Lines changed: 36 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
@@ -26,6 +26,6 @@ jobs:
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

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
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

.golangci.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
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$

cmd/multiping/destination.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

monitor/history.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)