summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--new.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/new.go b/new.go
index 79df202..efaf988 100644
--- a/new.go
+++ b/new.go
@@ -30,13 +30,13 @@ func FindPath(path string) *RepoStatus {
return windowMap[path]
}
-func NewRepoStatusWindow(path string) *RepoStatus {
+func NewRepoStatusWindow(path string) (error, *RepoStatus) {
if windowMap[path] == nil {
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
} else {
log.Warn("This already exists yet for path", path)
log.Warn("should return windowMap[path] here")
- return windowMap[path]
+ return nil, windowMap[path]
}
var realpath string
@@ -44,7 +44,7 @@ func NewRepoStatusWindow(path string) *RepoStatus {
homeDir, err := os.UserHomeDir()
if err != nil {
log.Log(WARN, "Error getting home directory:", err)
- return nil
+ return err, nil
}
goSrcDir := filepath.Join(homeDir, "go/src")
@@ -65,7 +65,7 @@ func NewRepoStatusWindow(path string) *RepoStatus {
if err != nil {
// log.Log(WARN, "Error reading .git/config:", filename, err)
// log.Log(WARN, "TODO: find .git/config in parent directory")
- return nil
+ return err, nil
}
rs := &RepoStatus{
@@ -122,5 +122,5 @@ func NewRepoStatusWindow(path string) *RepoStatus {
rs.setUserWorkingName()
windowMap[path] = rs
- return rs
+ return nil, rs
}