// helper methods for testing package test import ( "fmt" "path/filepath" "runtime" "testing" ) func Assert(t *testing.T, condition bool, explanation interface{}) { if !condition { if _, file, line, ok := runtime.Caller(1); ok { short := filepath.Base(file) t.Fatal(fmt.Sprintf("%s:%d: %s", short, line, explanation)) } t.Fatal(explanation) } }