From d3b2ee22b40c74ba0050f89f8738cfbc44537640 Mon Sep 17 00:00:00 2001 From: Alexandros Filios Date: Tue, 26 Jul 2022 19:28:36 +0200 Subject: [PATCH] Reduce staticcheck warnings (S1039) As part of issue #50, removed warnings related to: * S1039: removed unnecessary formatting Signed-off-by: Alexandros Filios --- integration/nwo/fsc/fsc.go | 6 ++---- integration/nwo/weaver/interopcc.go | 3 +-- platform/fabric/core/generic/msp/x509/deserializer.go | 2 +- platform/fabric/core/generic/ordering/client.go | 3 +-- platform/fabric/services/endorser/endorsement.go | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration/nwo/fsc/fsc.go b/integration/nwo/fsc/fsc.go index 2c336fc8a..54b3f151d 100755 --- a/integration/nwo/fsc/fsc.go +++ b/integration/nwo/fsc/fsc.go @@ -427,9 +427,7 @@ func (p *Platform) GenerateCoreConfig(peer *node2.Peer) { Expect(err).NotTo(HaveOccurred()) extensions = append(extensions, string(bs)) } else { - for _, s := range extensionsByPeerID { - extensions = append(extensions, s) - } + extensions = append(extensions, extensionsByPeerID...) } } @@ -481,7 +479,7 @@ func (p *Platform) FSCNodeRunner(node *node2.Peer, env ...string) *runner2.Runne commands.NodeStart{NodeID: node.ID()}, "", fmt.Sprintf("FSCNODE_CFG_PATH=%s", p.NodeDir(node)), - fmt.Sprintf("FSCNODE_PROFILER=true"), + "FSCNODE_PROFILER=true", ) cmd.Env = append(cmd.Env, env...) diff --git a/integration/nwo/weaver/interopcc.go b/integration/nwo/weaver/interopcc.go index a0f0d1898..a8bd351e4 100644 --- a/integration/nwo/weaver/interopcc.go +++ b/integration/nwo/weaver/interopcc.go @@ -7,7 +7,6 @@ SPDX-License-Identifier: Apache-2.0 package weaver import ( - "fmt" "path/filepath" "sync" @@ -28,7 +27,7 @@ func (p *Platform) InteropChaincodeFile() string { } func (p *Platform) interopccSetup(relay *RelayServer, cc *topology.ChannelChaincode) (*topology.ChannelChaincode, error) { - cc.Chaincode.Ctor = fmt.Sprintf(`{"Args":["initLedger","applicationCCID"]}`) + cc.Chaincode.Ctor = `{"Args":["initLedger","applicationCCID"]}` packageLock.Lock() defer packageLock.Unlock() diff --git a/platform/fabric/core/generic/msp/x509/deserializer.go b/platform/fabric/core/generic/msp/x509/deserializer.go index e7b020d64..b99507360 100644 --- a/platform/fabric/core/generic/msp/x509/deserializer.go +++ b/platform/fabric/core/generic/msp/x509/deserializer.go @@ -55,5 +55,5 @@ func (i *Deserializer) Info(raw []byte, auditInfo []byte) (string, error) { } func (i *Deserializer) String() string { - return fmt.Sprintf("Generic X509 Verifier Deserializer") + return "Generic X509 Verifier Deserializer" } diff --git a/platform/fabric/core/generic/ordering/client.go b/platform/fabric/core/generic/ordering/client.go index 400d3f534..08eca0b0a 100644 --- a/platform/fabric/core/generic/ordering/client.go +++ b/platform/fabric/core/generic/ordering/client.go @@ -9,7 +9,6 @@ package ordering import ( "context" "crypto/tls" - "fmt" "io" "strings" @@ -170,7 +169,7 @@ func toError(errs []error) error { return errs[0] } - errmsgs := []string{fmt.Sprint("Multiple errors occurred in order broadcast stream: ")} + errmsgs := []string{"Multiple errors occurred in order broadcast stream: "} for _, err := range errs { errmsgs = append(errmsgs, err.Error()) } diff --git a/platform/fabric/services/endorser/endorsement.go b/platform/fabric/services/endorser/endorsement.go index 87211280b..f60f6e5ac 100644 --- a/platform/fabric/services/endorser/endorsement.go +++ b/platform/fabric/services/endorser/endorsement.go @@ -166,7 +166,7 @@ func (c *collectEndorsementsView) Call(context view.Context) (interface{}, error tracker.Report(fmt.Sprintf("collectEndorsementsView: collected signature from %s", party)) } - tracker.Report(fmt.Sprintf("collectEndorsementsView done.")) + tracker.Report("collectEndorsementsView done.") return c.tx, nil }