Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 bug: (go get github.com\urfave\cli\v2 error ) #957

Closed
3 of 7 tasks
cw1997 opened this issue Nov 28, 2019 · 7 comments
Closed
3 of 7 tasks

v2 bug: (go get github.com\urfave\cli\v2 error ) #957

cw1997 opened this issue Nov 28, 2019 · 7 comments
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this

Comments

@cw1997
Copy link

cw1997 commented Nov 28, 2019

my urfave/cli version is v2

( Put the version of urfave/cli that you are using here )

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this problem? Here's the Github guide about searching.

Packaging Setup

  • My project is using go modules.
  • My project is using vendoring.
  • My project is automatically downloading the latest version.
  • I am unsure of what my packaging setup is.

Describe the bug

I can't install and go get the package.
When I run, show this error:

go get github.com/urfave/cli/v2
package github.com/urfave/cli/v2: cannot find package "github.com/urfave/cli/v2" in any of:
        C:\Go\src\github.com\urfave\cli\v2 (from $GOROOT)
        E:\cs\golang\gopath\src\github.com\urfave\cli\v2 (from $GOPATH)

Although I can find these files at %GOPATH%\src\github.com\urfave\cli,
and I use import "github.com/urfave/cli/v2"
show this error:

main.go:10:2: cannot find package "github.com/urfave/cli/v2" in any of:
	C:\Go\src\github.com\urfave\cli\v2 (from $GOROOT)
	E:\cs\golang\gopath\src\github.com\urfave\cli\v2 (from $GOPATH)

To reproduce

Describe the steps or code required to reproduce the behavior

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

If the issue relates to a specific open source Github repo, please link that repo here.

If you can reproduce this issue with a public CI system, please link a failing build here.

Want to fix this yourself?

We'd love to have more contributors on this project! If the fix for this bug is easily explained and very small, free free to create a pull request for it.

Run go env and paste its output here

E:\cs\golang\gopath\src\github.com\cw1997\all2mif\src>go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\changweimbp\AppData\Local\go-build
set GOENV=C:\Users\changweimbp\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\cs\golang\gopath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\CH
ANGW~1\AppData\Local\Temp\go-build534103886=/tmp/go-build -gno-record-gcc-switches

Very Thanks!!

@cw1997 cw1997 added status/triage maintainers still need to look into this kind/bug describes or fixes a bug area/v2 relates to / is being considered for v2 labels Nov 28, 2019
@AudriusButkevicius
Copy link
Contributor

I think you are using an old version of go that does not support go modules, so you can remove the v2 bit, but ideally you'd update go, as we'll keep breaking you.

@coilysiren
Copy link
Member

@cw1997 to super double confirm, can you run go version and show us the output?

@cw1997
Copy link
Author

cw1997 commented Nov 29, 2019

@cw1997 to super double confirm, can you run go version and show us the output?

C:\Users\changweimbp>go version
go version go1.13.4 windows/amd64

this is my golang version, but this is the latest version....w(゚Д゚)w

@coilysiren coilysiren reopened this Nov 29, 2019
@coilysiren
Copy link
Member

@cw1997 I believe what you need to do is change

go get github.com/urfave/cli/v2

to this

GO111MODULE=on go get github.com/urfave/cli/v2

can you try that and report back?

@cw1997
Copy link
Author

cw1997 commented Nov 29, 2019

Oh, it run success.
I'm very sorry to bother you and very thank you!!

The last time I used golang was two years ago and that version is go1.10 so I don't know the new feature about 'Go Module'.
Thank you for letting me know about such a useful new feature, ^_^.

@cw1997 cw1997 closed this as completed Nov 29, 2019
@coilysiren
Copy link
Member

Thanks for reporting back!

Apologies for the minor road bump, I think I'll update the documentation to mention GO111MODULE=on 🔍

@Ritesh-Swarnakar
Copy link

@cw1997 I believe what you need to do is change

go get github.com/urfave/cli/v2

to this

GO111MODULE=on go get github.com/urfave/cli/v2

can you try that and report back?

This is what I am getting. How to resolve this?
'GO111MODULE' is not recognized as an internal or external command,
operable program or batch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

4 participants