3 ms·
I see $GOPATH is no longer strictly needed, which is nice. But what's the deal with $GOROOT? I seem to always need it set but I don't know if that's just my wor
by kortex 3y ago
I see $GOPATH is no longer strictly needed, which is nice. But what's the deal with $GOROOT? I seem to always need it set but I don't know if that's just my workflow or force of habit.
- BarkMore 3y agoIt's either habbit or you are doing something out of the ordinary with your Go installation. The standard installation of Go has not required GOROOT for a very long time.
- typical182 3y agoPeople should essentially never set GOROOT. It's mostly a holdover. For example, Ian Lance Taylor on the core Go team wrote [0] somewhat recently: "It's a special purpose hook that is almost never needed". [0] https://groups.google.com/g/golang-nuts/c/qDhJbkE1QeY/m/JoV2bxWtBwAJ https://groups.google.com/g/golang-nuts/c/qDhJbkE1QeY/m/JoV2...
- liampulles 3y agoI use Makefiles for my projects, and right at the top I do: GOBIN := $(shell go env GOBIN) And then use that var where needed.