1
0
mirror of https://github.com/beego/bee.git synced 2024-11-25 20:10:55 +00:00

Merge pull request #356 from radioinmyhead/patch-2

fix GOROOT
This commit is contained in:
astaxie 2017-02-23 22:58:17 +08:00 committed by GitHub
commit c2161cac3f

View File

@ -26,6 +26,7 @@ import (
"path/filepath" "path/filepath"
"reflect" "reflect"
"regexp" "regexp"
"runtime"
"strconv" "strconv"
"strings" "strings"
"unicode" "unicode"
@ -402,6 +403,9 @@ func analyseControllerPkg(localName, pkgpath string) {
func isSystemPackage(pkgpath string) bool { func isSystemPackage(pkgpath string) bool {
goroot := os.Getenv("GOROOT") goroot := os.Getenv("GOROOT")
if goroot == "" {
goroot = runtime.GOROOT()
}
if goroot == "" { if goroot == "" {
logger.Fatalf("GOROOT environment variable is not set or empty") logger.Fatalf("GOROOT environment variable is not set or empty")
} }