diff options
| author | Jeff Carr <[email protected]> | 2024-12-11 19:31:37 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-11 19:31:37 -0600 |
| commit | dae2653975b6db822633430a97adbb21b52a99ff (patch) | |
| tree | 40e9fe53f9149ef090fb7bd40d2c77709b7904c8 /configLookup.go | |
| parent | 0235d4d0961d71acd3b678dad009d68713bb6621 (diff) | |
use 'all' instead of 'loop'
Diffstat (limited to 'configLookup.go')
| -rw-r--r-- | configLookup.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/configLookup.go b/configLookup.go index cda036e..9a61c2e 100644 --- a/configLookup.go +++ b/configLookup.go @@ -37,9 +37,9 @@ func (all *ForgeConfigs) UpdateGoPath(name string, gopath string) bool { func (fc *ForgeConfigs) IsReadOnly(gopath string) bool { var match *ForgeConfig - loop := fc.SortByGoPath() // get the list of repos - for loop.Scan() { - r := loop.Next() + all := fc.SortByGoPath() // get the list of repos + for all.Scan() { + r := all.Next() if r.GoPath == gopath { // exact gopath match if r.Writable { @@ -98,9 +98,9 @@ func (fc *ForgeConfigs) DebName(gopath string) string { // get "zookeeper" from "go.wit.com/apps/zookeeper" normalBase := filepath.Base(gopath) - loop := fc.SortByGoPath() - for loop.Scan() { - r := loop.Next() + all := fc.SortByGoPath() + for all.Scan() { + r := all.Next() if r.GoPath == gopath { // returns "zookeeper-go" for "go.wit.com/apps/zookeeper" if r.DebName != "" { @@ -127,9 +127,9 @@ func (fc *ForgeConfigs) IsPrivate(thing string) bool { // sort by path means the simple 'match' logic // here works in the sense the last directory match // is the one that is used - loop := fc.SortByGoPath() // get the list of repos - for loop.Scan() { - r := loop.Next() + all := fc.SortByGoPath() // get the list of repos + for all.Scan() { + r := all.Next() if r.GoPath == thing { // if private is set here, then ok, otherwise // still check if a Directory match exists @@ -168,9 +168,9 @@ func (fc *ForgeConfigs) IsPrivate(thing string) bool { func (fc *ForgeConfigs) IsFavorite(thing string) bool { var match *ForgeConfig - loop := fc.SortByGoPath() // get the list of repos - for loop.Scan() { - r := loop.Next() + all := fc.SortByGoPath() // get the list of repos + for all.Scan() { + r := all.Next() if r.GoPath == thing { if r.Favorite { return true @@ -201,9 +201,9 @@ func (fc *ForgeConfigs) IsFavorite(thing string) bool { func (fc *ForgeConfigs) IsWritable(thing string) bool { var match *ForgeConfig - loop := fc.SortByGoPath() // get the list of repos - for loop.Scan() { - r := loop.Next() + all := fc.SortByGoPath() // get the list of repos + for all.Scan() { + r := all.Next() if r.GoPath == thing { if r.Writable { return true |
