Not categorizing tests

Build tags

//go:build integration

package db_test
go test --tags=integration -v .

Environment variables

This provides information to the user that this test was skipped

func TestInsert(t *testing.T) {
  if os.Getenv("INTEGRATION") != true {
    t.Skip("skipping integration test")
  }
}

Short mode

func TestLongRunning(t *testing.T){
  if testing.Short() {
    t.Skip("skipping long running test")
  }
}
go test -short -v .

References