mirror of
https://github.com/beego/bee.git
synced 2025-06-11 13:30:39 +00:00
Fix generate swagger model api doc on Windows.
Add multiple gopath support for ParsePackagesFromDir. Improves gloomyzerg@39cc0bc04e109ff0f69e73d567354d9e82b7c24c fix for #332 that got lost on some merge.
This commit is contained in:
@ -61,12 +61,17 @@ func GetGOPATHs() []string {
|
||||
return paths
|
||||
}
|
||||
|
||||
// IsInGOPATH checks the path is in the fisrt GOPATH(/src) or not
|
||||
// IsInGOPATH checks whether the path is inside of any GOPATH or not
|
||||
func IsInGOPATH(thePath string) bool {
|
||||
if runtime.GOOS == "windows" {
|
||||
thePath = filepath.ToSlash(thePath)
|
||||
}
|
||||
return strings.Contains(thePath, GetGOPATHs()[0]+"/src")
|
||||
for _, gopath := range GetGOPATHs() {
|
||||
if strings.Contains(thePath, gopath + "/src") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsBeegoProject checks whether the current path is a Beego application or not
|
||||
|
Reference in New Issue
Block a user