1
0
mirror of https://github.com/beego/bee.git synced 2025-07-10 06:20:19 +00:00

bee pack auto generate comment router files

This commit is contained in:
wilhelmguo
2018-11-14 10:01:08 +08:00
parent 10bb0454f6
commit 5a7792d8b4
28 changed files with 7920 additions and 9 deletions

View File

@ -72,7 +72,7 @@ func GrepFile(patten string, filename string) (lines []string, err error) {
lines = make([]string, 0)
reader := bufio.NewReader(fd)
prefix := ""
isLongLine := false
var isLongLine bool
for {
byteLine, isPrefix, er := reader.ReadLine()
if er != nil && er != io.EOF {

30
vendor/github.com/astaxie/beego/utils/utils.go generated vendored Normal file
View File

@ -0,0 +1,30 @@
package utils
import (
"os"
"path/filepath"
"runtime"
"strings"
)
// GetGOPATHs returns all paths in GOPATH variable.
func GetGOPATHs() []string {
gopath := os.Getenv("GOPATH")
if gopath == "" && strings.Compare(runtime.Version(), "go1.8") >= 0 {
gopath = defaultGOPATH()
}
return filepath.SplitList(gopath)
}
func defaultGOPATH() string {
env := "HOME"
if runtime.GOOS == "windows" {
env = "USERPROFILE"
} else if runtime.GOOS == "plan9" {
env = "home"
}
if home := os.Getenv(env); home != "" {
return filepath.Join(home, "go")
}
return ""
}