Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save mindscratch/6168a495bc83783dfb2e to your computer and use it in GitHub Desktop.

Select an option

Save mindscratch/6168a495bc83783dfb2e to your computer and use it in GitHub Desktop.
golang integration test
package main
import "testing"
import "time"
import "fmt"
func TestBar(t *testing.T) {
fmt.Println("FOO sleeping")
time.Sleep(time.Second)
fmt.Println("FOO done")
}
// +build integration
// the blank line after the build constraints is required
package main
import "testing"
import "time"
import "fmt"
func TestBar(t *testing.T) {
fmt.Println("BAR sleeping")
time.Sleep(time.Second)
fmt.Println("BAR done")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment