diff --git a/g_docs.go b/g_docs.go
index <HASH>..<HASH> 100644
--- a/g_docs.go
+++ b/g_docs.go
@@ -26,6 +26,7 @@ import (
 	"path/filepath"
 	"reflect"
 	"regexp"
+	"runtime"
 	"strconv"
 	"strings"
 	"unicode"
@@ -403,6 +404,9 @@ func analyseControllerPkg(localName, pkgpath string) {
 func isSystemPackage(pkgpath string) bool {
 	goroot := os.Getenv("GOROOT")
 	if goroot == "" {
+		goroot = runtime.GOROOT()
+	}
+	if goroot == "" {
 		logger.Fatalf("GOROOT environment variable is not set or empty")
 	}
fix GOROOT 

set goroot by runtime.GOROOT if goroot is empty