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:
2
vendor/github.com/astaxie/beego/utils/file.go
generated
vendored
2
vendor/github.com/astaxie/beego/utils/file.go
generated
vendored
@ -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
30
vendor/github.com/astaxie/beego/utils/utils.go
generated
vendored
Normal 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 ""
|
||||
}
|
Reference in New Issue
Block a user