-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
chore: enable all rules from perfsprint #8194
base: main
Are you sure you want to change the base?
Conversation
8d1f7a7
to
be6aebd
Compare
Signed-off-by: Matthieu MOREL <[email protected]>
f3c8f15
to
7cefcc7
Compare
@@ -66,7 +66,7 @@ func TestRedisCache_PutArtifact(t *testing.T) { | |||
addr = "dummy:16379" | |||
} | |||
|
|||
c, err := cache.NewRedisCache(fmt.Sprintf("redis://%s", addr), "", "", "", false, 0) | |||
c, err := cache.NewRedisCache("redis://"+addr, "", "", "", false, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's too much. `fmt.Sprintf is easier to read than string concatenation, even with a performance downside. However, if it drastically improves performance, it's worth considering.
# Optimizes into strings concatenation. | ||
strconcat: false | ||
strconcat: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer not to use this optimization.
strconcat: true | |
strconcat: false |
@DmitriyLewen @simar7 @nikpivkin However, if you prefer string concatenation, I'm okay with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also vote not to use this. fmt.Sprintf
seems fine to me. Is this subjective or there's something on the table w.r.t. performance by using this?
Description
enable and fixes all rules from perfsprint linter