Skip to content

Instantly share code, notes, and snippets.

@rakyll rakyll/README
Last active Jan 27, 2016

Embed
What would you like to do?
You need to run tests with:
go test -tags=test
// +build !test
package a
func Hello() string {
return "hello"
}
package a
import "testing"
func TestHello(t *testing.T) {
if got, expected := Hello(), "hello from tests"; got != expected {
t.Errorf("got = %q; expected = %q", got, expected)
}
}
// +build test
package a
func Hello() string {
return "hello from tests"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.