Skip to content

Instantly share code, notes, and snippets.

@dlsniper
Created July 16, 2018 11:28
Show Gist options
  • Save dlsniper/5549e65cb2e85d72fd8e9d2dbea4b311 to your computer and use it in GitHub Desktop.
Save dlsniper/5549e65cb2e85d72fd8e9d2dbea4b311 to your computer and use it in GitHub Desktop.
Shell Script to perform tasks on binary
#!/bin/env bash
# Compile the using one of these commands:
# for Go 1.10 or later
go build -gcflags "all=-N -l" -o /tmp/demo github.com/app/demo
# for Go 1.9 or earlier
# go build -gcflags "-N -l" -o /tmp/demo github.com/app/demo
# Perform the binary manipulation here
# Now launch the binary using delve
dlv --listen=:2345 --headless=true --api-version=2 exec /tmp/demo
# Then go to the IDE and use the Go Remote run configuration type to
# connect to the debugger and start the debugging session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment