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

Cannot run gore #196

Closed
varun1729 opened this issue Nov 1, 2020 · 12 comments
Closed

Cannot run gore #196

varun1729 opened this issue Nov 1, 2020 · 12 comments

Comments

@varun1729
Copy link

varun1729 commented Nov 1, 2020

$ gore
gore: could not load 'fmt' package: err: exit status 1: stderr: build flag -mod=mod only valid when using modules

I have GOPATH and GOROOT set up correctly and it is reflected in go env

@itchyny
Copy link
Collaborator

itchyny commented Nov 2, 2020

Please reinstall gore.

@itchyny
Copy link
Collaborator

itchyny commented Nov 2, 2020

If the issue still occurs with 0.5.1, please reopen.

@itchyny itchyny closed this as completed Nov 2, 2020
@hulucc
Copy link

hulucc commented Nov 3, 2020

image

@felixbuenemann
Copy link

Please reopen. I have the same issue on macOS 10.15.7 and go 1.15.3 from Homebrew:

$ go version
go version go1.15.3 darwin/amd64
$ rm -rf ~/go/src/github.com/motemen ~/go/bin/gore
$ go get -u -a github.com/motemen/gore/cmd/gore
$ which gore
/Users/felix/go/bin/gore
$ ls -hal /Users/felix/go/bin/gore
-rwxr-xr-x  1 felix  staff   7.3M  3 Nov 19:21 /Users/felix/go/bin/gore
$ gore --version
gore 0.5.1 (rev: HEAD/go1.15.3)
$ gore
gore: could not load 'fmt' package: err: exit status 1: stderr: build flag -mod=mod only valid when using modules

So I guess it is safe to say that reinstalling does not fix the issue.

What worked for me:

$ cd ~/go/src/github.com/motemen/gore/cmd/gore
$ go install -a
$ gore
gore version 0.5.1  :help for help
gore>

I have no idea why it only works this way…

@itchyny
Copy link
Collaborator

itchyny commented Nov 4, 2020

How about omitting -u?
go get github.com/motemen/gore/cmd/gore

@hairyhenderson
Copy link

I'm also seeing this on macOS 10.15.7 and go 1.15.2

$ go get github.com/motemen/gore/cmd/gore
$ gore --version
gore 0.5.1 (rev: HEAD/go1.15.2)
$ gore
gore: could not load 'fmt' package: err: exit status 1: stderr: build flag -mod=mod only valid when using modules

@hairyhenderson
Copy link

Ok, seems like it's fixed with:

$ export GO111MODULE=on
$ go get github.com/motemen/gore/cmd/gore
$ gore
gore version 0.5.1  :help for help
gore>

@cive
Copy link

cive commented Nov 7, 2020

On WSL2, I tried it ( export GO111MODULE=on ). But I got this...

gore: could not load 'fmt' package: err: exit status 1: stderr: -mod=mod not supported (can be '', 'readonly', or 'vendor')

Edit:

Released version v0.5.0 looks fine on WSL2. There seems to be a problem with latest version... (v0.5.1)

gore
gore version 0.5.0  :help for help
gore> 

0.5.0...0.5.1 diff: v0.5.0...v0.5.1

around here? #192 #193

@ndac-todoroki
Copy link

I'm on WSL2 ubuntu, and was able to run 0.5.1 (where I first failed without export GO111MODULE=on )

~ 
17:29:39 ❯❯ env GO111MODULE=on go get github.com/motemen/gore/cmd/gore
go: downloading github.com/motemen/gore v0.5.1
go: found github.com/motemen/gore/cmd/gore in github.com/motemen/gore v0.5.1
go: downloading golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9
go: downloading github.com/motemen/go-quickfix v0.0.0-20200118031250-2a6e54e79a50
go: downloading github.com/mattn/go-runewidth v0.0.8

~ took 4s402ms
17:29:54 ❯❯ gore
gore version 0.5.1  :help for help
gore> ⏎

~ took 4s74ms
17:30:51 ❯❯ fish --version
fish, version 3.1.2

~ 
17:30:56 ❯❯ go version
go version go1.15.2 linux/amd64

@itchyny
Copy link
Collaborator

itchyny commented Nov 12, 2020

This is basically caused by golang/tools@2f4fa18. Disabling Modules fetches the lates tools lib.

@itchyny
Copy link
Collaborator

itchyny commented Jan 9, 2021

The golang/tools has been updated and even with the latest tools library, -mod=mod not supported error does not happen anymore.
Related commit is golang/tools@9ed4547.

@xulong3370
Copy link

try this, reinstall 0.5.0, go get -u github.com/motemen/gore/cmd/gore@v0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants