summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/unix.go b/unix.go
index c4b4828..b4f604f 100644
--- a/unix.go
+++ b/unix.go
@@ -3,6 +3,7 @@ package repostatus
import (
"errors"
+ "io/ioutil"
"os"
"os/exec"
"os/user"
@@ -203,3 +204,11 @@ func VerifyLocalGoRepo(gorepo string) bool {
log.Log(INFO, "go directory:", gitDir)
return IsDirectory(gitDir)
}
+
+func readFileToString(filename string) (string, error) {
+ data, err := ioutil.ReadFile(filename)
+ if err != nil {
+ return "", err
+ }
+ return strings.TrimSpace(string(data)), nil
+}