Description: Use parent dir as root rather than searching for .git. Author: Lena Voytek Forwarded: not-needed Last-Update: 2026-02-21 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/test/test.go +++ b/test/test.go @@ -35,24 +35,15 @@ "os" "path/filepath" "runtime" + "strings" ) var Update = flag.Bool("update", false, "update .golden files") func RootDir() string { _, filename, _, _ := runtime.Caller(1) - dir := filepath.Dir(filename) - if fileExists(dir + "/.git") { - return filepath.Clean(dir) - } - dir += "/" - for i := 0; i < 10; i++ { - dir = dir + "../" - if fileExists(dir + ".git") { - return filepath.Clean(dir) - } - } - panic("Cannot find .git/") + dir := filepath.Dir(filename) + "/" + return dir[:strings.Index(dir, "/go-mysql/")+len("/go-mysql/")] } func fileExists(file string) bool {