summaryrefslogtreecommitdiffstats
path: root/src/cmd/go/internal/load/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/internal/load/path.go')
-rw-r--r--src/cmd/go/internal/load/path.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/go/internal/load/path.go b/src/cmd/go/internal/load/path.go
new file mode 100644
index 0000000..584cdff
--- /dev/null
+++ b/src/cmd/go/internal/load/path.go
@@ -0,0 +1,18 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package load
+
+import (
+ "path/filepath"
+)
+
+// expandPath returns the symlink-expanded form of path.
+func expandPath(p string) string {
+ x, err := filepath.EvalSymlinks(p)
+ if err == nil {
+ return x
+ }
+ return p
+}