Skip to content

Commit dd89d31

Browse files
committed
ci: align staticcheck pins across Go workflows
1 parent a1c72ec commit dd89d31

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.github/workflows/cli-ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: go vet ./...
4444

4545
- name: Install staticcheck
46-
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@latest
46+
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@v0.7.0
4747

4848
- name: Staticcheck
4949
run: ./.bin/staticcheck ./...

‎.github/workflows/updater-ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: go vet ./...
4646

4747
- name: Install staticcheck
48-
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@latest
48+
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@v0.7.0
4949

5050
- name: Staticcheck
5151
run: ./.bin/staticcheck ./...

‎agent/internal/traefik/static.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const (
1515
metricsEntryPointAddr = "127.0.0.1:9100"
1616
)
1717

18+
// Whole-number buckets must be ints to match yaml.v3's decoded types.
1819
var prometheusLatencyBuckets = []interface{}{
1920
0.005,
2021
0.01,

‎agent/internal/traefik/static_test.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ func TestEnsurePrometheusMetricsConfigIsStable(t *testing.T) {
5353
if err != nil {
5454
t.Fatalf("failed to marshal config: %v", err)
5555
}
56-
if err := yaml.Unmarshal(data, &config); err != nil {
56+
var roundTripped map[string]interface{}
57+
if err := yaml.Unmarshal(data, &roundTripped); err != nil {
5758
t.Fatalf("failed to unmarshal config: %v", err)
5859
}
5960

60-
if ensurePrometheusMetricsConfig(config) {
61+
if ensurePrometheusMetricsConfig(roundTripped) {
6162
t.Fatal("expected second call to be stable")
6263
}
6364
}

0 commit comments

Comments
 (0)