Comments (12)
I agree this should work by default but for now you can add to each step:
export PATH=${PATH}:`go env GOPATH`/bin
See https://presstige.io/p/Using-GitHub-Actions-with-Go-2ca9744b531f4f21bdae9976d1ccbb58#e86c1c15-6f43-4f43-935f-37895bd14208 for a fuller example (I use that for running staticcheck)
(just a tip, I'm not the maintainer).
from setup-go.
Hi everyone, ressurecting the dead here...
Let's start by the beggining, you:
- put that on your gh action
- name: Setup Go environment uses: actions/[email protected]
- go check go env
GOPATH="/home/runner/go"
- go check $PATH
$PATH: /home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
- and see that all your go installs are on GOPATH /bin
I added to my action:
export PATH=${PATH}:
go env GOPATH/bin
and now it works fine.
Would it be possible to refix this?
Thanks
from setup-go.
actually after further investigation it looks like the env and path are already getting set, but to the wrong values.
Agreed. Will fix.
from setup-go.
In addition to that @devigned I think the ‘GOPATH’ statement two lines above that needs an ‘else’
from setup-go.
I just hit this problem and upgrading to v2-beta fixed this problem for me.
from setup-go.
Awesome to hear. I’ll probably release v2 Monday
from setup-go.
actually after further investigation it looks like the env and path are already getting set, but to the wrong values.
Below are some screenshots of the MacOS setup. go env
is correctly saying that GOPATH
is User/runner/go
. This means that GOBIN
will default to User/runner/go/bin
since it is unset.
If we look at PATH
, it seems that /usr/local/go/bin
is getting set. By my understanding, this is not the correct value for any operating system, definitely not macOS.
from setup-go.
Lines 119 to 121 in 75259a5
Should have an else and export the default GOBIN
into the path and set the PATH to include the GOBIN
.
from setup-go.
Agreed. If nothing is overridden, Golang defaults should be honored.
from setup-go.
Duplicate of #14
from setup-go.
This should be fixed in @v2-beta version of this action. See #14
from setup-go.
Nice! Thanks for putting this action together. I have been using it with a few projects.
from setup-go.
Related Issues (20)
- go 1.22.0-rc.1 is not found HOT 2
- setup-go does not work on macos-14 (M1) HOT 6
- How to run tests with latest golang version HOT 10
- More specific handling/detection of Go toolchain versions HOT 3
- Inaccurate description of version in go.mod HOT 2
- Please upgrade `go-actions` to 1.21.8 / 1.22.1 HOT 3
- Signing key has expired HOT 2
- Node16 deprecated HOT 1
- Support custom distribution location override HOT 1
- Can't cache dependencies from a composite action HOT 9
- Intermittent failures downloading go HOT 4
- I HOT 3
- I HOT 1
- Failure of "Validate 'setup-go'" on macos-latest HOT 3
- Annotation matcher can not match column ranges HOT 4
- Dependencies file is not found. Supported file pattern: go.sum HOT 9
- [Bug] CGO_ENABLED on macos amd64 is not correct HOT 8
- Caching should use go.mod, not go.sum HOT 3
- Why can't I re-use cache created by actions/setup-go for actions/cache? HOT 3
- Support using a later patch release than what's in go.mod HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setup-go.