# Go "package X is not in std" - Fix in CI

> Fix Go "package X is not in std" in CI - Go looked for a non-stdlib import in the standard library and did not find it. Require the providing module or fix the path.

Source: https://latchkey.dev/learn/go/go-package-is-not-in-std-in-ci  
Updated: 2026-06-26

Go classified an import as standard library and searched std for it. When the path is third-party, misspelled, or modules are off, std has nothing to offer and the build stops.

## Diagnose it: module path, proxy, or checksum?

Go module errors name the module but rarely the layer that failed. Separate the three: the module path does not resolve, the proxy cannot serve it, or the checksum database disagrees with what was downloaded.

```Terminal
# what Go resolves and from where
go env GOPROXY GOSUMDB GOPRIVATE GOFLAGS

# does the module resolve at all, bypassing the build?
go list -m -versions github.com/org/module

# verify the module cache against go.sum
go mod verify

# private modules must be excluded from proxy and sumdb
go env -w GOPRIVATE=github.com/yourorg/*
```

> A private module fetched through the public proxy fails with a confusing 410 or checksum mismatch rather than an auth error. Setting `GOPRIVATE` for your org prefix removes an entire class of CI-only module failures.

## FAQ

### What causes Go "package X is not in std"?

There are 2 common causes: third-party import not in go.mod and module mode disabled. A non-stdlib package is imported but no require provides it, so Go searches std and fails.

### How do I fix Go "package X is not in std"?

There are 2 fixes depending on which cause you have: add the providing module and keep module mode on. Work through them in order, since the first is the most common.

### What does Go "package X is not in std" actually mean?

A build fails with package X is not in std (GOROOT/src/X).

### How do I stop Go "package X is not in std" happening again?

Run go mod tidy after adding any import. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
