Skip to content

Commit 0a3c217

Browse files
FAB-3180 fix staticcheck errors in peer
peer/chaincode/install.go:46:26: printf-style function with dynamic first argument and no further arguments should use print-style function instead (SA1006) peer/chaincode/install.go:47:26: printf-style function with dynamic first argument and no further arguments should use print-style function instead (SA1006) peer/chaincode/instantiate.go:39:26: printf-style function with dynamic first argument and no further arguments should use print-style function instead (SA1006) peer/chaincode/instantiate.go:40:26: printf-style function with dynamic first argument and no further arguments should use print-style function instead (SA1006) peer/channel/join.go:71:2: this value of spec is never used (SA4006) Change-Id: I98d1871a554061c4ee4f72609bf5869ab6227d51 Signed-off-by: Christopher Ferris <[email protected]>
1 parent 56b6d12 commit 0a3c217

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

peer/chaincode/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const install_desc = "Package the specified chaincode into a deployment spec and
4343
func installCmd(cf *ChaincodeCmdFactory) *cobra.Command {
4444
chaincodeInstallCmd = &cobra.Command{
4545
Use: "install",
46-
Short: fmt.Sprintf(install_desc),
47-
Long: fmt.Sprintf(install_desc),
46+
Short: fmt.Sprint(install_desc),
47+
Long: fmt.Sprint(install_desc),
4848
ValidArgs: []string{"1"},
4949
RunE: func(cmd *cobra.Command, args []string) error {
5050
var ccpackfile string

peer/chaincode/instantiate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const instantiate_desc = "Deploy the specified chaincode to the network."
3636
func instantiateCmd(cf *ChaincodeCmdFactory) *cobra.Command {
3737
chaincodeInstantiateCmd = &cobra.Command{
3838
Use: instantiate_cmdname,
39-
Short: fmt.Sprintf(instantiate_desc),
40-
Long: fmt.Sprintf(instantiate_desc),
39+
Short: fmt.Sprint(instantiate_desc),
40+
Long: fmt.Sprint(instantiate_desc),
4141
ValidArgs: []string{"1"},
4242
RunE: func(cmd *cobra.Command, args []string) error {
4343
return chaincodeDeploy(cmd, args, cf)

peer/channel/join.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ func getJoinCCSpec() (*pb.ChaincodeSpec, error) {
6868
return nil, GBFileNotFoundErr(err.Error())
6969
}
7070

71-
spec := &pb.ChaincodeSpec{}
72-
7371
// Build the spec
7472
input := &pb.ChaincodeInput{Args: [][]byte{[]byte(cscc.JoinChain), gb}}
7573

76-
spec = &pb.ChaincodeSpec{
74+
spec := &pb.ChaincodeSpec{
7775
Type: pb.ChaincodeSpec_Type(pb.ChaincodeSpec_Type_value["GOLANG"]),
7876
ChaincodeId: &pb.ChaincodeID{Name: "cscc"},
7977
Input: input,

0 commit comments

Comments
 (0)