golang/go

cmd/go: confusing error message when `go list` is missing checksums for patterns outside the main module

Open

#59,755 opened on Apr 21, 2023

View on GitHub
 (11 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
BadErrorMessageFixPendingGoCommandNeedsFixhelp wantedmodules

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

What version of Go are you using (go version)?

Does this issue reproduce with the latest release?

Probably?

What operating system and processor architecture are you using (go env)?

What did you do?

Ran go list github.com/... in a repository and got

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

Running go mod tidy did not fix it.

Here's a MWE:

package main

import (
	"golang.org/x/exp/slog"
	"periph.io/x/host/v3"
)

func main() {
	slog.Any("", "")
	host.Init()
}

Running go mod init tg gives me the following go.mod and go.sum

module tg

go 1.19

require (
	golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
	periph.io/x/host/v3 v3.8.0
)

require periph.io/x/conn/v3 v3.7.0 // indirect
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb h1:rhjz/8Mbfa8xROFiH+MQphmAmgqRM0bOMnytznhWEXk=
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
periph.io/x/conn/v3 v3.7.0 h1:f1EXLn4pkf7AEWwkol2gilCNZ0ElY+bxS4WE2PQXfrA=
periph.io/x/conn/v3 v3.7.0/go.mod h1:ypY7UVxgDbP9PJGwFSVelRRagxyXYfttVh7hJZUHEhg=
periph.io/x/host/v3 v3.8.0 h1:T5ojZ2wvnZHGPS4h95N2ZpcCyHnsvH3YRZ1UUUiv5CQ=
periph.io/x/host/v3 v3.8.0/go.mod h1:rzOLH+2g9bhc6pWZrkCrmytD4igwQ2vxFw6Wn6ZOlLY=

What did you expect to see?

A list of go modules

What did you see instead?

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

Contributor guide