* fix #1014

* remove unused code

* * optimize generate pb.go on Windows
* format code
* optimize console.go

* version rollback

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2021-09-11 12:48:32 +08:00
committed by GitHub
parent 6bf6cfdd01
commit f0ed2370a3
8 changed files with 135 additions and 93 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"
"github.com/tal-tech/go-zero/tools/goctl/vars"
@@ -115,6 +116,12 @@ func FindProjectPath(loc string) (string, bool) {
// ReadLink returns the destination of the named symbolic link recursively.
func ReadLink(name string) (string, error) {
goos := runtime.GOOS
switch goos {
case vars.OsWindows:
return name, nil
}
name, err := filepath.Abs(name)
if err != nil {
return "", err