return the error
This commit is contained in:
parent
4d1301288e
commit
6a6ebf78b8
10
new.go
10
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue