Go / Golang - Impossible to run go build

38 views
Skip to first unread message

Jean-Charles Passepont

unread,
Nov 22, 2021, 10:31:50 AM11/22/21
to go-cd
Hi,

My use case is the following: I have a Go repository that has to be build and deployed on a target server.
I've had 0 issue with a yarn and npm projects (both installed on the target server).
Although I have installed Go (I mean Golang 1.17.3) on the target server, GoCD persist on returning:

go build took: 0.2s
Error happened while attempting to execute 'go build'.
Please make sure [go] can be executed on this agent.
[Debug Information] Environment variable PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

I've tried to add the path on the environment variables or even add steps to install Go(lang) during the GoCD steps but it seems overly complicated.

Has anyone successfully run a GoCD pipeline with Golang?

Many thanks.

Ashwanth Kumar

unread,
Nov 22, 2021, 7:03:14 PM11/22/21
to go...@googlegroups.com
From a GoCD point of view there is no difference between yarn build and go build. After adding go binary to PATH have you tried restarting the agents? If not please restart them and try running the pipeline. We do build go projects in GoCD without issues.



--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/fa855d7f-3526-434e-a1f0-dc847bffedebn%40googlegroups.com.

Jean-Charles Passepont

unread,
Nov 30, 2021, 5:30:40 AM11/30/21
to go-cd
Ok so I had to use `/usr/bin/go/bin/go build` weirdly.

 This way worked in the end so all good - thank you for the precisions!

Reply all
Reply to author
Forward
0 new messages