You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At https://github.com/GeertJohan/go.rice/blob/master/box.go#L66, the result of function errors.New is not actually used since err is local to case LocateFS such that errors.New("given name/path is not a directory") won't be assigned to the one declared outside the loop var err error.
var err error
for _, method := range order {
...
case LocateFS:
// resolve absolute directory path
err := b.resolveAbsolutePathFromCaller()
...
err = errors.New("given name/path is not a directory")
continue
}
At https://github.com/GeertJohan/go.rice/blob/master/box.go#L66, the result of function
errors.New
is not actually used sinceerr
is local tocase LocateFS
such thaterrors.New("given name/path is not a directory")
won't be assigned to the one declared outside the loopvar err error
.while function
errors.New
has no side effect:Another instance is at: https://github.com/GeertJohan/go.rice/blob/master/box.go#L83
A mini bug reproducer is available at:
https://play.golang.org/p/FA2ZsZ34zqJ
A possible fix is not to declare a local
err
within the cases, e.g.Found by static analyzer #deepgo
The text was updated successfully, but these errors were encountered: