GNU/Linux xterm-256color bash 385 views

Follow these instructions to build and compress your application:

  1. Verify UPX Installation:

    which upx
    • Check if UPX is installed and available in your PATH.
  2. Download Go Dependencies:

    go get -d -v
    • Fetch the necessary Go modules and dependencies.
  3. Build the Application:

    go build -a -tags "netgo production" -p 1 -ldflags '-s -w -extldflags "-static"' -o app.run .
    • Compile the application with the specified flags and output it as app.run.
  4. Compress the Executable:

    upx app.run
    • Use UPX to compress the app.run executable.