Skip to content
Latchkey

Go "go vet" failures block go test - Fix in CI

go test runs a subset of go vet before executing tests. A vet finding - like a bad Printf verb - fails the run before any test executes.

What this error means

A run fails with a vet message such as Printf format %d has arg of wrong type string and [vet failed], even though the tests themselves are fine. It means the implicit vet pass flagged code.

go
# example.com/app
./log.go:12:2: Printf format %d has arg s of wrong type string
FAIL	example.com/app [build failed]

Common causes

A real vet issue in the package

go test ran vet and found a genuine problem, such as a format-verb mismatch or a misused lock.

A vet check too strict for the code

A specific vet analyzer flags a pattern you intend to keep, blocking the test run.

How to fix it

Fix the vet finding

  1. Correct the flagged code, e.g. match the Printf verb to the argument type.
  2. Re-run go vet to confirm it is clean.
Terminal
go vet ./...
go test ./...

Scope the vet pass deliberately

  1. If a specific analyzer is wrong for your code, disable just that check rather than all vetting.
Terminal
go test -vet=off ./...   # last resort, prefer fixing the finding

How to prevent it

  • Run go vet ./... locally before pushing.
  • Treat vet findings as build failures, not warnings.
  • Keep Printf verbs aligned with argument types.

Frequently asked questions

What causes "go vet blocks go test"?
go test ran vet and found a genuine problem, such as a format-verb mismatch or a misused lock.
How do I fix go vet blocks go test?
Fix the vet finding

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card