Skip to content

Instantly share code, notes, and snippets.

@olebedev
Last active August 29, 2015 14:08
Show Gist options
  • Save olebedev/712d92fe2e01e754eaf1 to your computer and use it in GitHub Desktop.
Save olebedev/712d92fe2e01e754eaf1 to your computer and use it in GitHub Desktop.
Golang test debugging snippet for cgdb
#!/usr/bin/env bash
rm go-swarm.test || true
nohup go test -c -gcflags '-N -l' -work github.com/olebedev/go-swarm
WORK=$(cat nohup.out)
rm nohup.out
cgdb go-swarm.test -- -d ${WORK#WORK=} || rm go-swarm.test || true
# gdb --tui go-swarm.test -d ${WORK#WORK=} || rm go-swarm.test || true
rm go-swarm.test || true
echo ${WORK#WORK=}
@olebedev
Copy link
Author

And after starting the script you may type like this: (gdb) b github.com/olebedev/go-swarm/emitter_test.go:29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment