Cli: go mod error for v2

Created on 6 Nov 2019  路  5Comments  路  Source: urfave/cli

#go mod init
#go get gopkg.in/urfave/cli.v2

got error

go: finding gopkg.in/urfave/cli.v2 v2.0.0-alpha.2
go get gopkg.in/urfave/cli.v2: gopkg.in/urfave/[email protected]: invalid version: go.mod has non-....v2 module path "github.com/urfave/cli/v2" at revision v2.0.0-alpha.2

Most helpful comment

Try using this command instead

go get github.com/urfave/cli/v2

All 5 comments

Try using this command instead

go get github.com/urfave/cli/v2

well done

What is the correct import to use? import "github.com/urfave/cli/v2" is what worked for me, but godoc is not located there: https://godoc.org/github.com/urfave/cli/v2

Nm, the import I asked seems to be correct according to the README, but the go get doesn't seem to match as of this commit:

https://github.com/urfave/cli/tree/754ed1bf85da93060d928f9eca0bce83eb5f19be#using-v2-releases

It should be / instead of a dot.

Was this page helpful?
0 / 5 - 0 ratings