gox
gox copied to clipboard
gox build -ldflags
Hi guys, I have a problem.I want use -ldflags options to build go package. My shell command is gox -os "linux" -arch amd64 -ldflags="" . But it not work. Can anybody tell me what's wrong with me? Thx a lot
You don't specify what doesn't work, that would've been helpful to answer your question. However I'll try to give some examples that might solve the unspecified problem you're having.
Try either of:
gox -ldflags "-s -w" -osarch="linux/amd64" .
Specifies the architecture, might help you on architecture miss-match
gox -ldflags "-s -w" -os="linux" .
Just an example of how to specify ldflags
gox -ldflags "-s -w" -os="linux" -rebuild .
Try rebuilding the binary, in case of stale pkg weirdness.
@Dynom thx a lot,i'll retry it.