Created
October 7, 2016 03:01
-
-
Save mattn/340de4347052863a3b8f2b2208169169 to your computer and use it in GitHub Desktop.
go test -x -ldflags "-X foo.Foo=bar" で実行
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo | |
const Foo = "fooooooo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo | |
import ( | |
"testing" | |
) | |
func TestSimple(t *testing.T) { | |
value := Foo | |
expected := "fooooooo" | |
if value != expected { | |
t.Fatalf("Expected %v, but %v:", expected, value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment