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

Add $GOBIN #41

Closed
wants to merge 5 commits into from
Closed

Add $GOBIN #41

wants to merge 5 commits into from

Conversation

fsouza
Copy link

@fsouza fsouza commented Mar 2, 2020

  • Set GOBIN to $(go env GOPATH)/bin
  • Add GOBIN to the PATH

Should make the setup of tools like golangci-lint or golint work with a
simple go get.

Using $GOBIN instead of $GOPATH/bin because the goal is to have GOPATH
not being directly referenced. Also, in the future, GOBIN will have a
default value too, so we would not need to manually set it, just add it
to the path (see discussion in golang/go#23439).

Closes #14.

- Set $GOBIN to $(go env GOPATH)/bin
- Add $GOBIN to the PATH

Should make the setup of tools like golangci-lint or golint work with a
simple `go get`.

Using $GOBIN instead of $GOPATH/bin because the goal is to have GOPATH
not being directly referenced. Also, in the future, GOBIN will have a
default value too, so we would not need to manually set it, just add it
to the path (see discussion in golang/go#23439).

Closes #14.
1.14.0 satisfies ^1.13.6, so the test started failing once Go 1.14 was
released.

This test is going to break again when Go 1.15 is released, so maybe we
need a better fix?
@fsouza
Copy link
Author

fsouza commented Mar 2, 2020

To see how this can be used: https://github.com/fsouza/vod-module-sprite/pull/15/files

(Also notice the previous workaround in the "setup GOBIN" step).

Commit 25c870b caused the tests to fail because what seemed to be an incorrect/fragile test. "1.14.0" satisfies "^1.13.6" (and it looks like semver doesn't support the ~ operator yet, which is likely what the test is designed to test?)

I adjusted the test to make it green (using ^1.14.0 instead of ^1.13.6), but if we keep that test as is, it's going to fail every time there's a new "minor" release of Go.

Should fix the behavior on Windows.
On Windows, `go env GOPATH` keeps the end-line character, making it
unusable (see sample build failure:
https://github.com/fsouza/vod-module-sprite/runs/478762225?check_suite_focus=true#step:5:62).
@fsouza
Copy link
Author

fsouza commented Mar 8, 2020

@bryanmacfarlane friendly ping? 😁

fsouza added a commit to fsouza/vod-module-sprite that referenced this pull request Mar 9, 2020
@mingrammer
Copy link

I'm waiting for this feature :)

@fsouza
Copy link
Author

fsouza commented Mar 26, 2020

Implemented in #47.

@fsouza fsouza closed this Mar 26, 2020
@fsouza fsouza mentioned this pull request Mar 26, 2020
@bryanmacfarlane
Copy link
Member

Thank you @fsouza for raising the issue.

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

Successfully merging this pull request may close these issues.

Add $GOPATH/bin to $PATH
3 participants