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

make dev-deps failing to install goreleaser #198

Closed
powersjcb opened this issue Jun 16, 2020 · 4 comments
Closed

make dev-deps failing to install goreleaser #198

powersjcb opened this issue Jun 16, 2020 · 4 comments

Comments

@powersjcb
Copy link
Contributor

powersjcb commented Jun 16, 2020

What happened:
make dev-deps fails to install goreleaser

$ go get github.com/goreleaser/goreleaser
package github.com/google/go-github/v28/github: cannot find package "github.com/google/go-github/v28/github" in any of:
	/usr/local/Cellar/go/1.14.3/libexec/src/github.com/google/go-github/v28/github (from $GOROOT)
	/Users/jpowers/go/src/github.com/google/go-github/v28/github (from $GOPATH)

Resolution:
Install goreleaser with go modules enabled

$ GO111MODULE=on go get -d github.com/goreleaser/goreleaser
go: github.com/goreleaser/goreleaser upgrade => v0.138.0

Reference: goreleaser/goreleaser#1013

Environment:

  • fresh laptop, go installed using homebrew
  • go-sdk version: master
  • go version (e.g go version): go version go1.14.3 darwin/amd64
  • OS (e.g: cat /etc/os-release): darwin
@dhermes
Copy link
Contributor

dhermes commented Jun 16, 2020

That is quite surprising since gomod has been on by default since like 1.12 or 1.13.

@powersjcb
Copy link
Contributor Author

powersjcb commented Jun 18, 2020

Hmm, if you clone this project into $GOPATH/src/, then the config GO111MODULE=off will be used. It appears to be the default for GOPATH sources without a go.mod file in the directory.

https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k

@dhermes
Copy link
Contributor

dhermes commented Jun 19, 2020

Yeah I just reproduced on my dev machine, I just was surprised by the behavior and yet to see it in the wild. I ran the go get command fully outside of $GOPATH (with go1.14) and saw the same behavior.

@dhermes dhermes closed this as completed Jun 19, 2020
@powersjcb
Copy link
Contributor Author

Yeah, upon reading the documentation for goreleaser, they recommend installing a pinned binary release directly.

(In general, I've seen problems with using go get to install dev dependencies because it doesn't pin the versions. However, this does work nicely as a cross platform way to install the dep.)

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

2 participants