mardi 13 septembre 2016

How example can be run in test?

I'm trying to run example in test. However after running, warning is shown. testing: warning: no tests to run

This example code includes comment // Output comment.

func ExampleMethod1() {
    fmt.Printf("result: %x", Method1())
    // Output: xxxx
}

What is wrong? When running test, I exec like this. go test -v xxxx_test.go

Thanks.

Harry

Aucun commentaire:

Enregistrer un commentaire