-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Update golangci-lint to v2.6.0 #35801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update golangci-lint to v2.6.0 #35801
Conversation
|
I think I will revert these string builder changes and disable the offending rule, it seems useless. |
|
The It says "This avoids quadratic memory allocation and improves performance." so maybe it is worth it. I will fix those var names. |
|
I manually cleaned up the stringsbuilder cases, should be ready. |
|
I really dislike unnecessary lint rules. And I have strong objection for this Sprintf change, it doesn't improve readability. |
|
I think we could disable |
|
I've disabled |
|
The previous autofixes with the ugly var names were from diff --git i/modules/git/foreachref/format.go w/modules/git/foreachref/format.go
index d9573a55d6..d2f9998fe8 100644
--- i/modules/git/foreachref/format.go
+++ w/modules/git/foreachref/format.go
@@ -74,10 +74,10 @@ func (f Format) Parser(r io.Reader) *Parser {
// hexEscaped produces hex-escpaed characters from a string. For example, "\n\0"
// would turn into "%0a%00".
func (f Format) hexEscaped(delim []byte) string {
- escaped := ""
+ var escaped strings.Builder
for i := range delim {
- escaped += "%" + hex.EncodeToString([]byte{delim[i]})
+ escaped.WriteString("%" + hex.EncodeToString([]byte{delim[i]}))
}
- return escaped
+ return escaped.String()
}Would that be an acceptable fix? |
|
I've re-enabled the modernize rule and ran |
This reverts commit f2347df.
|
Actually, I've reverted, we can discuss the merits of |
https://github.com/golangci/golangci-lint/releases/tag/v2.6.0
modernizelinter is enabled, this is the same asgopls modernizeperfsprintlinter is disabled because it conflicts withmodernize(maybe there is a middle ground)deprecatedCommentis disabled as it conflicts withgo-swagger