go test -v
func ExampleFunc() {
result := Func()
fmt.Println(result)
// Output: wantResult
}
func TestFunc(t *testing.T) {
got := Func()
want := wantResult
if got != want {
t.Errorf("expect %v but got %v", want, got)
}
}
go test -bench=.
func BenchmarkFunc(b *testing.B) {
for i := 0; i < b.N; i++ {
Func()
}
}
go test -cover
go install golang.org/x/tools/cmd/godoc
godoc -http :8000
localhost:8000/pkg