* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user