go module @latest found but does not contain package

4,924 views
Skip to first unread message

Tong Sun

unread,
Jul 24, 2020, 1:08:06 PM7/24/20
to golang-nuts
Hi, 

How to get around the following, go module @latest found but does not contain package? 

$ cd /tmp/015-file

$ GO111MODULE=on

$ go mod init github.com/mkideal/cli/015-file
go: creating new go.mod: module github.com/mkideal/cli/015-file

$ cat go.mod 
module github.com/mkideal/cli/015-file

go 1.14

$ go build
go: finding module for package github.com/mkideal/cli
go: finding module for package github.com/mkideal/cli/ext
main.go:6:2: module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli
main.go:7:2: module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli/ext

$ go get -v github.com/mkideal/cli
go: github.com/mkideal/cli upgrade => v0.2.2

$ go get -v ./...
go: finding module for package github.com/mkideal/cli
go: finding module for package github.com/mkideal/cli/ext
go: finding module for package github.com/mkideal/cli
go: finding module for package github.com/mkideal/cli/ext
main.go:6:2: module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli
main.go:7:2: module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli/ext

$ go version
go version go1.14.1 linux/amd64

This is under Ubuntu 20.04.

Brian Candler

unread,
Jul 25, 2020, 6:29:40 AM7/25/20
to golang-nuts
What's in your "main.go" ?

antoni...@gmail.com

unread,
Jul 25, 2020, 9:56:09 AM7/25/20
to golang-nuts
Thanks for the reply Brian.


Brian Candler

unread,
Jul 25, 2020, 12:25:15 PM7/25/20
to golang-nuts
Works fine for me.  Inside an empty directory:
go: creating new go.mod: module github.com/mkideal/cli/015-file
$ go build
go: finding module for package github.com/mkideal/cli/ext
go: finding module for package github.com/mkideal/cli
go: downloading github.com/mkideal/cli v0.2.2
go: downloading github.com/mkideal/pkg v0.1.2
go: downloading github.com/labstack/gommon v0.3.0
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/mattn/go-colorable v0.1.7
go: downloading golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
$ go version
go version go1.14.5 linux/amd64

Tong Sun

unread,
Jul 25, 2020, 2:17:32 PM7/25/20
to golang-nuts
Thanks a lot Brian!

I upgraded to go version go1.14.3 linux/amd64 in Ubuntu 20.04 LTS and now the problem is gone. thx!
Reply all
Reply to author
Forward
0 new messages