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

Viper seems to crash gotype #783

Closed
CorentinDeBoisset opened this issue Oct 12, 2019 · 2 comments
Closed

Viper seems to crash gotype #783

CorentinDeBoisset opened this issue Oct 12, 2019 · 2 comments

Comments

@CorentinDeBoisset
Copy link

CorentinDeBoisset commented Oct 12, 2019

I tried to find an explanation for this, but i can't seem to succeed...

Whenever i try to run gotype -t -e main.go, i get the following error:

main.go:4:2: could not import myproject/cmd (type-checking package "myproject/cmd" failed (/<path>/backend/cmd/root.go:6:2: could not import github.com/spf13/viper (type-checking package "github.com/spf13/viper" failed (/Users/corentin/go/pkg/mod/github.com/spf13/viper@v1.4.0/flags.go:3:8: could not import github.com/spf13/pflag (go/build: importGo github.com/spf13/pflag: exit status 1
error writing go.mod: open /Users/corentin/go/pkg/mod/github.com/spf13/viper@v1.4.0/go.mod298498081.tmp: permission denied

)))))
zsh: exit 2     gotype -t -e main.go

It seems as if a temporary go.mod was required or something. If i completely comment out viper from my project, it will give the expected result.

Also - and that's when it gets really weird - if i keep viper in my project I will get the error when running gotype in a terminal but not when it's running in sublime-linter-gotype. In this case, i get the correct linting.

@CorentinDeBoisset
Copy link
Author

I also opened an issue in the go repository because I don't know if the error is caused by gotype or viper.

@CorentinDeBoisset
Copy link
Author

Seems like it's indeed a problem on go-build's side. Closing the issue !

And sorry for the disturbance.

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

1 participant