Skip to content
Latchkey
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.

Test & vet

Test failures, timeouts, and race detector.

Explore other topics