go: updates to go.mod needed Go Origin: Application & API Last updated 4 Nov 2026

Go: go: updates to go.mod needed; to update it: go mod tidy

go.mod is out of sync with the imports in your code, and Go is running with -mod=readonly (the default).

Exact message you may see go: updates to go.mod neededgo: updates to go.mod needed; to update it: go mod tidygo: inconsistent vendoringgo.mod requires go >= 1.22 (running go 1.21)go: go.mod file indicates go 1.22, but maximum supported version is
Seen on: Go

Meaning

Run go mod tidy to add missing requirements and drop unused ones, then commit go.mod and go.sum. In CI use go mod tidy && git diff --exit-code to enforce it. The same message appears when a required Go version in go.mod is newer than your toolchain.

Common causes

  • Imports added without go get
  • go.mod edited by hand
  • Dependency upgraded in another branch
  • go.mod go directive newer than installed Go
  • Vendor mode mismatch

⚡ Quick fix

  1. go mod tidy and commit both files
  2. Upgrade the Go toolchain when go.mod requires a newer version
  3. Use go mod vendor only if you use -mod=vendor

Detailed fix by platform

Go

  1. go mod tidy && go mod verify

How to diagnose

  1. Imports — New since go.mod last tidied?
  2. Version — go directive vs toolchain?
  3. Files — go.sum committed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

cannot find package in any of GOROOT / GOPATH — Go: cannot find package "github.com/pkg/errors" in any of: /usr/local/go/src/github.com/pkg/errors (from $GOROOT) /go/src/github.com/pkg/errors (from $GOPATH) (Go)cannot find package i…invalid version: unknown revision — Go: go: github.com/foo/bar@v1.2.3: invalid version: unknown revision v1.2.3 (Go)invalid version: unkn…listen tcp :8080: bind: address already in use — Go: listen tcp :8080: bind: address already in use (Go)listen tcp :8080: bin…missing go.sum entry — Go: missing go.sum entry for module providing package github.com/pkg/errors (imported by app); to add: go get app (Go)missing go.sum entryno required module provides package — Go: no required module provides package github.com/foo/bar; to add it: go get github.com/foo/bar (Go)no required module pr…terminal prompts disabled / 410 Gone (private module) — Go: fatal: could not read Username for 'https://github.com': terminal prompts disabled (Go)terminal prompts disa…verifying module: checksum mismatch / SECURITY ERROR — Go: verifying module: checksum mismatch — SECURITY ERROR This download does NOT match an earlier download recorded in go.sum (Go)verifying module: che…go: updat…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.