fix(cmd/gf): creating logic.go empty folder when there is no correct logic service (#3815)

This commit is contained in:
oldme
2024-09-28 11:28:06 +08:00
committed by GitHub
parent 8708dc7940
commit f45f64897a
6 changed files with 54 additions and 14 deletions

View File

@ -364,11 +364,11 @@ func AssertNil(value interface{}) {
// which will be joined with current system separator and returned with the path.
func DataPath(names ...string) string {
_, path, _ := gdebug.CallerWithFilter([]string{pathFilterKey})
path = filepath.Dir(path) + string(filepath.Separator) + "testdata"
path = filepath.Dir(path) + "/testdata"
for _, name := range names {
path += string(filepath.Separator) + name
path += "/" + name
}
return path
return filepath.FromSlash(path)
}
// DataContent retrieves and returns the file content for specified testdata path of current package