Merge pull request #388 from beego/master

send the PR from master to develop
This commit is contained in:
Sergey Lanzman 2017-03-23 16:01:45 +02:00 committed by GitHub
commit 701b2e2ea8
1 changed files with 8 additions and 0 deletions

View File

@ -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{}