mirror of
https://github.com/beego/bee.git
synced 2024-11-22 10:10:53 +00:00
fix GOROOT
set goroot by runtime.GOROOT if goroot is empty
This commit is contained in:
parent
14eeb07402
commit
cf1809a64b
@ -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")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user