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 committed 2025-08-30 14:13:44 -03:00
1 parent f3d52ba7a8
commit 612ad7da27
5 files changed
+10 -7

No files matched your search

+4 -3
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
}