about summary refs log tree commit diff
path: root/gopkgs
diff options
context:
space:
mode:
Diffstat (limited to 'gopkgs')
-rw-r--r--gopkgs/utils/utils.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/gopkgs/utils/utils.go b/gopkgs/utils/utils.go
index 53136878dea3..7d662d08668b 100644
--- a/gopkgs/utils/utils.go
+++ b/gopkgs/utils/utils.go
@@ -21,6 +21,11 @@ func HomeDir() string {
 	return user.HomeDir
 }
 
+// Returns true if `info` is a symlink.
+func IsSymlink(info os.FileMode) bool {
+	return info&os.ModeSymlink != 0
+}
+
 // Return true if `path` exists and false otherwise.
 func FileExists(path string) bool {
 	if _, err := os.Stat(path); os.IsNotExist(err) {