4 ms·
Two notes on Go. Since Drew is stripping the binaries for many other languages, he should also do it for Go: go build -ldflags '-s -w' -o test test.go Also,
by majewsky 7y ago
Two notes on Go. Since Drew is stripping the binaries for many other languages, he should also do it for Go:
go build -ldflags '-s -w' -o test test.go
Also, since he's complaining about the difficulty of obtaining a static build in Go: There's an issue for that. (https://github.com/golang/go/issues/26492 https://github.com/golang/go/issues/26492) Drew definitely knows, he left an incredibly unhelpful comment there yesterday.
- Aeolun 7y agoYou do have to wonder why nobody thought ‘this is getting a bit crazy’ before though.
- tptacek 7y agoYou do?
- Aeolun 7y agoIt is known. I guess I could have written: I think someone should have wondered whether this was actually a reasonable way to make a statically linked binary before. Maybe if you’ve gotten used to invoking the magic it doesn’t seem quite so arcane anymore.
- hundt 7y agoFWIW if you don't need cgo then CGO_ENABLED=0 is sufficient to get a static binary. The tricky part is getting a static binary while also embedding C libraries. That's what the github issue is about.
- Lammy 7y agoTry the pronoun form of "one"
- saagarjha 7y agoUnhelpful, but I must be jaded because I’m not sure I’d call it “incredibly unhelpful”.