%goflags -cover %goflags // Clear %goflags %goflags "" %goflags -cover %env GOCOVERDIR /tmp/gonb_examples_test_goflags_cover !mkdir -p $GOCOVERDIR ; rm -f ${GOCOVERDIR}/* func A() { fmt.Println("A") } func B() { fmt.Println("B") } %% A() !go tool covdata func -i "${GOCOVERDIR}" %reset type Point struct{ X, Y float64} func (p *Point) ManhattanLen() float64 { return p.X + p.Y } %% p := Point{3,4} fmt.Println(p.ManhattanLen()) !*go build -gcflags=-m