use fmt.Sprint for string to int conversion

This commit is contained in:
Anton Kaliaev
2020-11-10 16:36:46 +04:00
parent c03ce1a05f
commit 94ea3c83a8
3 changed files with 4 additions and 4 deletions

View File

@@ -60,10 +60,10 @@ func TestContains(t *testing.T) {
func BenchmarkCMapHas(b *testing.B) {
m := NewCMap()
for i := 0; i < 1000; i++ {
m.Set(string(i), i)
m.Set(fmt.Sprint(i), i)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
m.Has(string(i))
m.Has(fmt.Sprint(i))
}
}

View File

@@ -382,7 +382,7 @@ func benchmarkNClients(n int, b *testing.B) {
s.PublishWithEvents(
ctx,
"Gamora",
map[string][]string{"abci.Account.Owner": {"Ivan"}, "abci.Invoices.Number": {string(i)}},
map[string][]string{"abci.Account.Owner": {"Ivan"}, "abci.Invoices.Number": {fmt.Sprint(i)}},
)
}
}

View File

@@ -209,7 +209,7 @@ func getServiceURL(rootURL string) (url, urnDomain string, err error) {
defer r.Body.Close() // nolint: errcheck
if r.StatusCode >= 400 {
err = errors.New(string(r.StatusCode))
err = errors.New(fmt.Sprint(r.StatusCode))
return
}
var root Root