From 9350a45315715525ffe5c52950195c80a4681c4b Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 27 Oct 2023 11:15:40 +0800 Subject: [PATCH] chore: unnecessary use of fmt.Sprintf --- src/ctl/service/r2/store/stub/store.go | 2 +- src/dbnode/storage/shard_fetch_blocks_metadata_test.go | 2 +- src/query/graphite/graphite/graphite_types.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ctl/service/r2/store/stub/store.go b/src/ctl/service/r2/store/stub/store.go index f3f88c29a0..d028420313 100644 --- a/src/ctl/service/r2/store/stub/store.go +++ b/src/ctl/service/r2/store/stub/store.go @@ -410,7 +410,7 @@ func (s *store) CreateNamespace( case s.data.ErrorNamespace: return view.Namespace{}, r2.NewInternalError(fmt.Sprintf("could not create namespace: %s", namespaceID)) case s.data.ConflictNamespace: - return view.Namespace{}, r2.NewVersionError(fmt.Sprintf("namespaces version mismatch")) + return view.Namespace{}, r2.NewVersionError("namespaces version mismatch") default: for _, n := range s.data.Namespaces.Namespaces { if namespaceID == n.ID { diff --git a/src/dbnode/storage/shard_fetch_blocks_metadata_test.go b/src/dbnode/storage/shard_fetch_blocks_metadata_test.go index 10c4ddabe1..5ee4260cfb 100644 --- a/src/dbnode/storage/shard_fetch_blocks_metadata_test.go +++ b/src/dbnode/storage/shard_fetch_blocks_metadata_test.go @@ -288,7 +288,7 @@ func TestShardFetchBlocksMetadataV2WithSeriesCachePolicyNotCacheAll(t *testing.T if expectedBlock.Checksum == nil { assert.Nil(t, actualBlock.Checksum) } else if actualBlock.Checksum == nil { - assert.Fail(t, fmt.Sprintf("expected checksum but no actual checksum")) + assert.Fail(t, "expected checksum but no actual checksum") } else { assert.Equal(t, *expectedBlock.Checksum, *actualBlock.Checksum) } diff --git a/src/query/graphite/graphite/graphite_types.go b/src/query/graphite/graphite/graphite_types.go index ab7bb8bf9f..f77b81008b 100644 --- a/src/query/graphite/graphite/graphite_types.go +++ b/src/query/graphite/graphite/graphite_types.go @@ -23,7 +23,6 @@ package graphite import ( "bytes" "encoding/json" - "fmt" "math" "net/http" "strconv" @@ -106,7 +105,7 @@ func (dp RenderDatapoints) Get(i int) (time.Time, float64) { case time.Time: return timestamp, value default: - panic(fmt.Sprintf("unsupported timestamp type")) + panic("unsupported timestamp type") } }