chore: unnecessary use of fmt.Sprintf (#4349)

Remove fmt.Sprintf() calls where the format string contains no formatting verbs.
This commit is contained in:
guangwu 2023-07-13 00:44:29 +08:00 committed by GitHub
parent 4444485dfe
commit 4674b98cfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -56,8 +56,8 @@ func TestValidTimestamp(t *testing.T) {
{"good - now + 200ms", fmt.Sprint(time.Now().Add(200 * time.Millisecond).Unix()), false},
{"bad - now + 10m", fmt.Sprint(time.Now().Add(10 * time.Minute).Unix()), true},
{"bad - now - 10m", fmt.Sprint(time.Now().Add(-10 * time.Minute).Unix()), true},
{"malformed - non int", fmt.Sprint("pomerium"), true},
{"malformed - negative number", fmt.Sprint("-1"), true},
{"malformed - non int", "pomerium", true},
{"malformed - negative number", "-1", true},
{"malformed - huge number", fmt.Sprintf("%d", 10*10000000000), true},
}
for _, tt := range tests {