chore: use t.Errorf(...) instead of t.Error(fmt.Sprintf(...))

This commit is contained in:
guoguangwu
2023-07-13 13:19:43 +08:00
committed by finley
parent 8873975901
commit 2a0d96b8c3
6 changed files with 66 additions and 71 deletions

View File

@@ -1,7 +1,6 @@
package database
import (
"fmt"
"github.com/hdt3213/godis/lib/utils"
"github.com/hdt3213/godis/redis/protocol"
"github.com/hdt3213/godis/redis/protocol/asserts"
@@ -74,7 +73,7 @@ func TestGeoDist(t *testing.T) {
result := execGeoDist(testDB, utils.ToCmdLine(key, pos1, pos2, "km"))
bulkReply, ok := result.(*protocol.BulkReply)
if !ok {
t.Error(fmt.Sprintf("expected bulk protocol, actually %s", result.ToBytes()))
t.Errorf("expected bulk protocol, actually %s", result.ToBytes())
return
}
dist, err := strconv.ParseFloat(string(bulkReply.Arg), 10)
@@ -89,7 +88,7 @@ func TestGeoDist(t *testing.T) {
result = execGeoDist(testDB, utils.ToCmdLine(key, pos1, pos2, "m"))
bulkReply, ok = result.(*protocol.BulkReply)
if !ok {
t.Error(fmt.Sprintf("expected bulk protocol, actually %s", result.ToBytes()))
t.Errorf("expected bulk protocol, actually %s", result.ToBytes())
return
}
dist, err = strconv.ParseFloat(string(bulkReply.Arg), 10)