News for hackers. Stuff that matters.
Re:How to start a Go project in 2023 by kortex on Tuesday May 23, 2023 @03:00PM (#36049154)
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.
Re:How to start a Go project in 2023 by BarkMore on Tuesday May 23, 2023 @03:42PM (#36049826)
It's either habbit or you are doing something special when installing Go. The standard installation of GO has not required GOROOT for a very long time.
Re:How to start a Go project in 2023 by typical182 on Tuesday May 23, 2023 @03:52PM (#36049958)
People 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/JoV2...

Re:How to start a Go project in 2023 by liampulles on Tuesday May 23, 2023 @04:53PM (#36050735)
I use Makefiles for my projects, and right at the top I do:

GOBIN := $(shell go env GOBIN)

And then use that var where needed.