News for hackers. Stuff that matters.
Re:Some Go web dev notes by rmac on Sunday September 29, 2024 @03:10PM (#41689608)
the whole gobin / gopath thing was annoying as a beginner: I just want to build this module and use that local module

go build ./... Goes where ?

Re:Some Go web dev notes by coffeeindex on Sunday September 29, 2024 @03:24PM (#41689695)
I believe it is recommended to not use gobin/gopath anymore.

go test ./… tests all files in the project, so I assume build does something similar.

Re:Some Go web dev notes by NAHWheatCracker on Sunday September 29, 2024 @05:06PM (#41690556)
My experience with go build ./... is that it compiles everything but it doesn't make the binaries.

> When compiling multiple packages or a single non-main package, build compiles the packages but discards the resulting object, serving only as a check that the packages can be built.

From https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependenc...

A bit annoying when you want to build a bunch of executables, but it's not something I need often and it's easy to script.

Re:Some Go web dev notes by arccy on Sunday September 29, 2024 @06:30PM (#41691371)

  go build -o some/dir/ ./...
will actually output the binaries
Re:Some Go web dev notes by NAHWheatCracker on Sunday September 29, 2024 @06:41PM (#41691466)
Sick, I couldn't figure it out when I needed it so I just manually created a 20 line script to cd into each directory and go build.