Skip to content

Instantly share code, notes, and snippets.

@mattn
Created October 7, 2016 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/340de4347052863a3b8f2b2208169169 to your computer and use it in GitHub Desktop.
Save mattn/340de4347052863a3b8f2b2208169169 to your computer and use it in GitHub Desktop.
go test -x -ldflags "-X foo.Foo=bar" で実行
package foo
const Foo = "fooooooo"
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