From dbc7d57a08368692fb8e5ebb9a963b4f645f2ee6 Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Fri, 14 Feb 2025 12:18:48 -0800 Subject: [PATCH] netrc/netrc.go: use constant format string The "go vet -printf ./..." command, when run with Go 1.24 (and a matching Go version number in the "go.mod" file), now detects format strings that are not constants, as described in golang/go#60529. We have one such non-constant format string in the newToken() function of the "netrc" package, so we adjust it now to use a standard format string with a specifier verb. This issue was reported in: https://github.com/git-lfs/git-lfs/issues/5968#issuecomment-2600792917 --- netrc/netrc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netrc/netrc.go b/netrc/netrc.go index 834d1ed..b06fadf 100644 --- a/netrc/netrc.go +++ b/netrc/netrc.go @@ -358,7 +358,7 @@ func newToken(rawb []byte) (*token, error) { t.kind = tkComment // this is a comment return &t, nil } - return &t, fmt.Errorf("keyword expected; got " + string(tkind)) + return &t, fmt.Errorf("keyword expected; got %s", string(tkind)) } return &t, nil }