Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit f97996b

Browse files
committed
chore: unnecessary use of fmt.Sprintf
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
1 parent 5d6ca32 commit f97996b

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

pkg/client/common/selection/dynamicselection/pgresolver/pgresolverimpl.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func (c *peerGroupResolver) Resolve(peers []fab.Peer) (PeerGroup, error) {
8181
for i, grp := range peerGroups {
8282
s += fmt.Sprintf("%d - %+v", i, grp)
8383
if i+1 < len(peerGroups) {
84-
s += fmt.Sprintf(" OR ")
84+
s += " OR "
8585
}
8686
}
87-
s += fmt.Sprintf(" ")
87+
s += " "
8888
}
8989
logger.Debugf(s)
9090
}
@@ -107,10 +107,10 @@ func (c *peerGroupResolver) getPeerGroups(peerRetriever MSPPeerRetriever) ([]Pee
107107
for i, g := range mspGroups {
108108
s += fmt.Sprintf("%+v", g)
109109
if i+1 < len(mspGroups) {
110-
s += fmt.Sprintf(" OR ")
110+
s += " OR "
111111
}
112112
}
113-
s += fmt.Sprintf(" ")
113+
s += " "
114114
logger.Debugf(s)
115115
}
116116

pkg/common/errors/multi/multi.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ SPDX-License-Identifier: Apache-2.0
1111
package multi
1212

1313
import (
14-
"fmt"
1514
"strings"
1615
)
1716

@@ -71,7 +70,7 @@ func (errs Errors) Error() string {
7170
return errs[0].Error()
7271
}
7372

74-
errors := []string{fmt.Sprint("Multiple errors occurred:")}
73+
errors := []string{"Multiple errors occurred:"}
7574
for _, err := range errs {
7675
errors = append(errors, err.Error())
7776
}

pkg/fab/resource/resource_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package resource
88

99
import (
1010
"bytes"
11-
"fmt"
1211
"io/ioutil"
1312
"path/filepath"
1413
"testing"
@@ -59,7 +58,7 @@ func TestCreateChannel(t *testing.T) {
5958

6059
// Setup mock orderer
6160
verifyBroadcast := make(chan *fab.SignedEnvelope)
62-
orderer := mocks.NewMockOrderer(fmt.Sprintf("0.0.0.0:1234"), verifyBroadcast)
61+
orderer := mocks.NewMockOrderer("0.0.0.0:1234", verifyBroadcast)
6362

6463
// Create channel without envelope
6564
reqCtx, cancel := contextImpl.NewRequest(ctx, contextImpl.WithTimeout(10*time.Second))

0 commit comments

Comments
 (0)