github.com/cleey/can-go@v1.0.1/pkg/generate/file_test.go (about) 1 package generate 2 3 import ( 4 "os" 5 "testing" 6 7 "gotest.tools/v3/assert" 8 ) 9 10 func runTestInDir(t *testing.T, dir string) func() { 11 // change working directory to project root 12 wd, err := os.Getwd() 13 assert.NilError(t, err) 14 assert.NilError(t, os.Chdir(dir)) 15 return func() { 16 assert.NilError(t, os.Chdir(wd)) 17 } 18 }