Skip to content

Fix go vet ./... findings - #2

Open
randomizedcoder wants to merge 1 commit into
masterfrom
go-vet-cleanup
Open

Fix go vet ./... findings#2
randomizedcoder wants to merge 1 commit into
masterfrom
go-vet-cleanup

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

Internal review PR against my fork's master.

go test's built-in vet subset does not run the composites or unreachable analyzers, so these go vet ./... findings slip through the normal test pipeline:

  • config: drop the unreachable return nil after the exhaustive switch in Module.UnmarshalYAML (both the valid case and default already return).
  • prober/dns: use keyed fields for the dns.Question composite literal — robust to field reordering in github.com/miekg/dns.
  • prober: use keyed fields for the config.HeaderMatch literals in the HTTP header-match tests (17 occurrences).

No behavior change. go vet ./... is clean afterwards; go build, go test ./... pass.

🤖 Generated with Claude Code

`go test`'s built-in vet subset does not run the `composites` and
`unreachable` analyzers, so these slipped through CI:

- config: drop the unreachable `return nil` after the exhaustive
  switch in Module.UnmarshalYAML (both cases already return).
- prober/dns: use keyed fields for the dns.Question literal, so it is
  robust to field reordering in github.com/miekg/dns.
- prober: use keyed fields for the config.HeaderMatch literals in the
  HTTP header-match tests.

No behavior change; `go vet ./...` is now clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: randomizedcoder <dave.seddon.ca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant