I am trying to add an example to a package and run the example through go test, however this example never runs.
For example, see this meaning: https://gist.github.com/85469ecc65bb5bb85857
The bottom line is example_test.go:
package cow_test
import (
cow "gist.github.com/85469ecc65bb5bb85857"
)
func Example() {
cow.Poke()
}
But when I run this:
testing: warning: no tests to run
PASS
ok command-line-arguments 0.002s
However, other packages from stdlib work just fine:
# cd /usr/lib/go/src/errors
# go test -v example_test.go
=== RUN: Example
--- PASS: Example (0.00s)
PASS
ok command-line-arguments 0.002s
What is wrong with my example?
source
share