Profiling golang projects

# .go file
import (
    _ "net/http/pprof"
)

# bash
$ curl -sK -v localhost:30020/debug/pprof/heap > heap.out
$ go tool pprof heap.out
(pprof) png
Generating report in profile001.png
(pprof) exit
$ go tool pprof -http=:8080 heap.out

Output in png requires graphviz (brew install graphviz)