multi: fix non-constant input of fmt.Errorf

Fixed multiple cases in which a non-constact string variable was used as a
format string for fmt.Errorf.
This commit is contained in:
Boris Nagaev
2025-08-19 14:52:28 -03:00
parent f3d52ba7a8
commit 612ad7da27
5 changed files with 10 additions and 7 deletions

View File

@@ -136,7 +136,8 @@ func IPLockChecker() (string, checkers.Func) {
// check.
pr, ok := peer.FromContext(ctx)
if !ok {
return fmt.Errorf("unable to get peer info from context")
return fmt.Errorf("unable to get peer info from " +
"context")
}
peerAddr, _, err := net.SplitHostPort(pr.Addr.String())
if err != nil {
@@ -144,8 +145,8 @@ func IPLockChecker() (string, checkers.Func) {
}
if !net.ParseIP(arg).Equal(net.ParseIP(peerAddr)) {
msg := "macaroon locked to different IP address"
return fmt.Errorf(msg)
return fmt.Errorf("macaroon locked to different IP " +
"address")
}
return nil
}