diff options
| author | Jeff Carr <[email protected]> | 2024-11-20 15:57:34 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-20 15:57:34 -0600 |
| commit | 704d06ba87ac8bc4af4abc1ed88efed82df7127d (patch) | |
| tree | 57c9fed02e508c51b50cb046e9fae3662f0e02a0 /update.go | |
| parent | f1c2695662ea01e05271505e7d5c49f8590b7ff7 (diff) | |
UpdateGoPath() (probably without memory corruption)
Diffstat (limited to 'update.go')
| -rw-r--r-- | update.go | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,11 +1,13 @@ package forgepb -import ( - "os" -) +func (all *Repos) UpdateGoPath(name string, gopath string) bool { + oldr := all.DeleteByName(name) + if oldr == nil { + // nothing to update + return false + } -func (repos *Repos) UpdateGoPath(r *Repo, gopath string) { - r.Gopath = gopath - repos.ConfigSave() - os.Exit(0) + // update gopath and append it back to the list + oldr.GoPath = gopath + return all.Append(oldr) } |
