Reputation: 1337
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 executed like this.
go test -v xxxx_test.go
Thanks.
Harry
Upvotes: 1
Views: 163
Reputation: 1337
After this post, I found it.
My xxx_test.go file didn't include Testxxx func at all. xxx_test.go fires need it at least one. After adding Testxxx func besides Example, example code worked!
Thanks!!
Upvotes: 1