Go
Go build, module, and test failures - diagnosed.
Fix Go CI failures: module resolution and checksum errors, build constraints, proxy timeouts, and test failures. Practical fixes for go build, go mod, and go test.
Modules & proxy
go.sum, checksum mismatches, and GOPROXY.
"cannot find main module"Fix Go "cannot find main module; see go help modules" in CI - the command ran outside any module root.
"cannot find package ... in GOPATH"Fix Go "cannot find package ... in any of (GOROOT/GOPATH)" in CI - GO111MODULE=off forced legacy GOPATH
"lookup proxy.golang.org: no such host"Fix Go "dial tcp: lookup proxy.golang.org: no such host" in CI - a DNS resolution failure reaching the module
"does not contain main module"Fix Go "directory prefix X does not contain main module or its selected dependencies" in CI - the command ran
"go mod tidy" errorsFix Go "go mod tidy" failures in CI - unresolved imports, "updates to go.mod needed", or a tidy that fails
bad GOFLAGS / GONOSUMCHECKFix Go "GOFLAGS: ... cannot be set" and unrecognized GONOSUMCHECK/GONOSUMDB in CI - a malformed environment
"inconsistent vendoring; go mod vendor"Fix Go "inconsistent vendoring; to sync run go mod vendor" in CI - vendor/modules.txt no longer matches
"inconsistent vendoring"Fix Go "inconsistent vendoring" in CI - vendor/modules.txt does not match go.mod.
"malformed module path: missing dot"Fix Go "malformed module path: missing dot in first path element" in CI - the module path is not a valid
"missing go.sum entry"Fix Go "missing go.sum entry for module providing package" in CI - go.sum lacks a checksum the readonly build
"missing go.sum entry"Fix Go "missing go.sum entry for module" in CI - go.sum lacks a hash a build needs because tidy was not run
"package X is not in std"Fix Go "package X is not in std" in CI - Go looked for a non-stdlib import in the standard library and did
"toolchain not available"Fix Go "toolchain X not available" / GOTOOLCHAIN download failures in CI - Go could not obtain the required
"unknown directive: toolchain"Fix Go "unknown directive: toolchain" in CI - go.mod has a toolchain line an older Go cannot parse.
"verifying X: checksum mismatch"Fix Go "verifying module: checksum mismatch" against the sum database in CI - the downloaded bytes do not
"certificate signed by unknown authority"Fix Go "x509: certificate signed by unknown authority" fetching modules in CI - a TLS-intercepting proxy
Build & compile
Build constraints, cgo, and linker errors.
"no matching files found"Fix Go //go:embed failures in CI - "no matching files found", "pattern ...
"cannot find GOROOT"Fix Go "cannot find GOROOT directory" in CI - GOROOT points at a missing path, usually a stale or hand-set
"cannot use X as type"Fix Go "cannot use X (variable of type A) as B value in argument" in CI - a value of the wrong type was
"declared and not used"Fix Go "declared and not used" and "imported and not used" compile errors in CI - Go treats unused variables
"mixed named and unnamed parameters"Fix Go "syntax error: mixed named and unnamed parameters" in CI - a function signature that names some
"command-line-arguments not main"Fix Go "package command-line-arguments is not a main package" in CI - go build/run got file paths that are
"protoc-gen-go: program not found"Fix protoc "protoc-gen-go: program not found or is not executable" in CI - the Go protobuf plugin is not
"undefined: X"Fix Go "undefined: Name" compile errors in CI - a removed or renamed API in an upgraded dependency, a wrong
staticcheck / golangci-lintFix Go staticcheck and golangci-lint failures in CI - linters flagged real issues or config drift.
"composite literal uses unkeyed fields"Fix go vet "composite literal uses unkeyed fields" in CI - a struct literal lists values positionally and vet
"SA1019: is deprecated"Fix staticcheck SA1019 "X is deprecated" in CI - code uses an API marked deprecated.
Test & vet
Test failures, timeouts, and race detector.
test package load failedFix Go test "build failed" from a bad import in the test package in CI - a missing or wrong import path stops
coverage: no statementsFix Go coverage anomalies in CI - "no packages being tested depend on matches" or "coverage: [no statements]"
golangci-lint timeoutFix golangci-lint "level=error msg='Timeout exceeded'" / context deadline in CI - a lint run that exceeds its
Explore other topics
GitHub ActionsWorkflow, runner, and YAML errors - diagnosed and fixed.
Node.js & npmnpm, yarn, and pnpm failures in CI - solved.
DockerBuild, run, compose, and registry errors - explained.
Pythonpip, poetry, venv, and pytest failures - fixed.
Java & JVMMaven, Gradle, and JVM failures in CI - resolved.
RustCargo and toolchain failures in CI - fixed.