logic invert

This commit is contained in:
Josh Deprez 2021-08-15 17:11:26 +10:00
parent f89d79f69d
commit c6d6536e49

View file

@ -84,13 +84,15 @@ func Walk(c interface{}, v func(interface{}) bool) {
if !v(c) { if !v(c) {
return return
} }
if sc, ok := c.(Scanner); ok { sc, ok := c.(Scanner)
for _, c := range sc.Scan() { if !ok {
if !v(c) { return
return }
} for _, c := range sc.Scan() {
Walk(c, v) if !v(c) {
return
} }
Walk(c, v)
} }
} }