otel-cli
otel-cli copied to clipboard
Does the binary have to be so large?
> go install github.com/equinix-labs/otel-cli@latest
...
> ls -halt ~/go/bin/otel-cli
-rwxr-xr-x@ 1 dima staff 19M 26 Nov 12:42 /Users/dima/go/bin/otel-cli*/Users/dima/go/bin/otel-cli*
> strip ~/go/bin/otel-cli
> ls -halt ~/go/bin/otel-cli
-rwxr-xr-x@ 1 dima staff 18M 26 Nov 12:42 /Users/dima/go/bin/otel-cli*
Go binaries are statically built by default with no external dependency on system libraries.
You can save some space by building with debugging symbols stripped:go install -ldflags "-s -w" ./...
This cut the binary from 19M to 13M.
If you are using an operating system that supports it, you can try go install -buildmode=shared (optionally with the ldflags) for a dynamically linked binary.