diff options
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/osutil/osutil.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index 465679ced..3c98a7f68 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -333,10 +333,13 @@ func Abs(path string) string { if wd1, err := os.Getwd(); err == nil && wd1 != wd { panic(fmt.Sprintf("wd changed: %q -> %q", wd, wd1)) } - if path == "" || filepath.IsAbs(path) { + if path == "" { return path } - return filepath.Join(wd, path) + if !filepath.IsAbs(path) { + path = filepath.Join(wd, path) + } + return filepath.Clean(path) } // MonotonicNano returns monotonic time in nanoseconds from some unspecified point in time. |
