mirror of
https://github.com/golang/go.git
synced 2024-09-21 10:28:27 +00:00
cmd/go: use the global rooted path name
Change-Id: I4a450af5f35f0ad4e4652789f1eda4d3171610e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/302852 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
db4adb1a9b
commit
6b6ea3271f
@ -32,10 +32,8 @@ func ShortPath(path string) string {
|
||||
// made relative to the current directory if they would be shorter.
|
||||
func RelPaths(paths []string) []string {
|
||||
var out []string
|
||||
// TODO(rsc): Can this use Cwd from above?
|
||||
pwd, _ := os.Getwd()
|
||||
for _, p := range paths {
|
||||
rel, err := filepath.Rel(pwd, p)
|
||||
rel, err := filepath.Rel(Cwd, p)
|
||||
if err == nil && len(rel) < len(p) {
|
||||
p = rel
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user