Monday, October 20, 2025
HomeGolangGentoo go1.21.4 secure set up together with go1.20.4 - Getting Assist

Gentoo go1.21.4 secure set up together with go1.20.4 – Getting Assist


Hello
I’m new to go as a Gentoo Linux person. The present go in my Gentoo Workstation is of go1.20.4 that are depended by:

equery d go
 * These packages depend upon go:
app-metrics/prometheus-2.43.0-r2 (>=dev-lang/go-1.18)
app-shells/fzf-0.39.0 (>=dev-lang/go-1.18)
dev-lang/go-1.20.4 (dev-lang/go)
dev-util/android-tools-34.0.0 (dev-lang/go)
dev-util/promu-0.14.0 (>=dev-lang/go-1.18)
sys-libs/libcap-2.69 (instruments ? dev-lang/go)

On this case, I’ve no a traditional technique to set up the newest go model of go1.21.4 to construct some superior community challenge. The official package deal had been downloaded and put in in “/usr/native/” by which I can solely name the binary path /usr/native/go/bin/go to implement the constructing of goal challenge. I’ve simply learn some fundamental tutorial in https://go.dev/doc/ whereas I’ve not discovered the correct description of my drawback but.

Please inform me the official and regular technique to choose the model of go compiler from native path like “/usr/native”.

Thanks

Now I exploit makefile flexibly to name the go1.21.4 together with the Gentoo system go1.20. Are there any higher methodology than makefile? I don’t affirm it’s strong to construct the go challenge with native put in model of go together with a makefile with particular $(GO), when you really feel it’s versatile, please inform me.
Thanks.

Hello @Kocha_Saito, welcome to the discussion board.

There are a number of choices obtainable to put in a number of variations of Go side-by-side.

The built-in methodology is go set up:

$ go set up golang.org/dl/go1.18.3@newest
$ go1.18.3 obtain

The binary of this model could be invoked as go1.18.3.

For extra comfort, a number of third-party instruments permit managing Go variations, corresponding to:

Learn extra particulars right here: Tips on how to use a number of Go variations alongside one another

Respect Mr ChristophBerger,
Thanks to your good recommendation. In my scenario, there are another go challenge which invoke construct.sh as their builder the place the go.mod include completely different model of go. Within the easiest case, I can deploy particular makefile to name completely different string path than go to invoke the custom-made put in model of go to construct. Whereas in a lot of the sensible case, they use construct.sh to construct the challenge the place it’s somewhat dangerous to switch the go by go1.xx.yy within the script construct.sh I believe.
For the third social gathering ones, I desire I can write a anaconda for go sometime… Now my various to construct the initiatives(with script) is so as to add line #export PATH="/usr/native/go/bin:$PATH" in ~/.bashrc or ~/.zshrc to overwrite the system path of go in Gentoo Linux based mostly on the model I would like in particular go challenge, which doesn’t have an effect on the Portage/emerge in my case, since we(gentoo person) swap as root to handle @world set in Portage generally.
Thanks for you good recommendation once more and greatest want to talk with you once more
Faithfully me

Certainly, it is a particular scenario.

Two fast ideas on this –

  1. Possibly direnv helps? This software makes use of .envrc information to specify folder-specific atmosphere settings. Once you cd into such a folder, the settings in .envrc turn into lively, if you cd out of the folder, the settings vanish. This might be a manner of adjusting the Go path with out messing with construct.sh.

  2. Go 1.21 is ready to obtain the toolchains of newer Go variations if the go.mod file requires them. This manner, no matter minimal Go model a go.mod file requires, the presently put in Go command would be capable to compile that code. Sadly, you’d have to attend till Gentoo’s packages arrive at Go 1.21…

Christophberger,
Thanks to your recommendation. I’ve full the compile and check of these golang initiatives with my various. In Gentoo methods, there ought to be slots for go by which we will invoke

eselect record go
eselect set go NUMBER

to specify the emerged go in Gentoo Methods. I’ll strive your recommendation within the deeper improvement loop in myself challenge.

Thanks Faithfully !!!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments