diff --git a/utils/utils.go b/utils/utils.go index a7da051..b41de0a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -61,6 +61,14 @@ func GetGOPATHs() []string { return paths } +// IsInGOPATH checks the path is in the fisrt GOPATH(/src) or not +func IsInGOPATH(thePath string) bool { + if runtime.GOOS == "windows" { + thePath = filepath.ToSlash(thePath) + } + return strings.Contains(thePath, GetGOPATHs()[0]+"/src") +} + // IsBeegoProject checks whether the current path is a Beego application or not func IsBeegoProject(thePath string) bool { mainFiles := []string{}