Skip to content

Commit afb02e5

Browse files
committed
mailbox: fix non-constant format string in error message
Fixes the following error: mailbox/client_conn.go:551:25: non-constant format string in call to fmt.Errorf.
1 parent 3c31aca commit afb02e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mailbox/client_conn.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package mailbox
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"regexp"
78
"strings"
@@ -548,7 +549,7 @@ func stripJSONWrapper(wrapped string) (string, error) {
548549

549550
if errorPattern.MatchString(wrapped) {
550551
errMsg := errorPattern.ReplaceAllString(wrapped, "${1}")
551-
return "", fmt.Errorf(errMsg)
552+
return "", errors.New(errMsg)
552553
}
553554

554555
return "", fmt.Errorf("unrecognized JSON message: %v", wrapped)

0 commit comments

Comments
 (0)