@@ -106,12 +106,12 @@ func chaincodeInvokeOrQuery(cmd *cobra.Command, args []string, invoke bool, cf *
106
106
logger .Infof ("Invoke result: %v" , proposalResp )
107
107
} else {
108
108
if proposalResp == nil {
109
- return fmt .Errorf ("Error query %s by endorsing: %s\n " , chainFuncName , err )
109
+ return fmt .Errorf ("Error query %s by endorsing: %s" , chainFuncName , err )
110
110
}
111
111
112
112
if chaincodeQueryRaw {
113
113
if chaincodeQueryHex {
114
- err = errors .New ("Options --raw (-r) and --hex (-x) are not compatible\n " )
114
+ err = errors .New ("Options --raw (-r) and --hex (-x) are not compatible" )
115
115
return
116
116
}
117
117
fmt .Print ("Query Result (Raw): " )
@@ -130,7 +130,7 @@ func chaincodeInvokeOrQuery(cmd *cobra.Command, args []string, invoke bool, cf *
130
130
func checkChaincodeCmdParams (cmd * cobra.Command ) error {
131
131
//we need chaincode name for everything, including deploy
132
132
if chaincodeName == common .UndefinedParamValue {
133
- return fmt .Errorf ("Must supply value for %s name parameter.\n " , chainFuncName )
133
+ return fmt .Errorf ("Must supply value for %s name parameter." , chainFuncName )
134
134
}
135
135
136
136
if cmd .Name () == instantiate_cmdname || cmd .Name () == install_cmdname || cmd .Name () == upgrade_cmdname {
@@ -142,35 +142,35 @@ func checkChaincodeCmdParams(cmd *cobra.Command) error {
142
142
// if it's not a deploy or an upgrade we don't need policy, escc and vscc
143
143
if cmd .Name () != instantiate_cmdname && cmd .Name () != upgrade_cmdname {
144
144
if escc != common .UndefinedParamValue {
145
- return fmt . Errorf ("escc should be supplied only to chaincode deploy requests" )
145
+ return errors . New ("escc should be supplied only to chaincode deploy requests" )
146
146
}
147
147
148
148
if vscc != common .UndefinedParamValue {
149
- return fmt . Errorf ("vscc should be supplied only to chaincode deploy requests" )
149
+ return errors . New ("vscc should be supplied only to chaincode deploy requests" )
150
150
}
151
151
152
152
if policy != common .UndefinedParamValue {
153
- return fmt . Errorf ("policy should be supplied only to chaincode deploy requests" )
153
+ return errors . New ("policy should be supplied only to chaincode deploy requests" )
154
154
}
155
155
} else {
156
156
if escc != common .UndefinedParamValue {
157
157
logger .Infof ("Using escc %s" , escc )
158
158
} else {
159
- logger .Infof ("Using default escc" )
159
+ logger .Info ("Using default escc" )
160
160
escc = "escc"
161
161
}
162
162
163
163
if vscc != common .UndefinedParamValue {
164
164
logger .Infof ("Using vscc %s" , vscc )
165
165
} else {
166
- logger .Infof ("Using default vscc" )
166
+ logger .Info ("Using default vscc" )
167
167
vscc = "vscc"
168
168
}
169
169
170
170
if policy != common .UndefinedParamValue {
171
171
p , err := cauthdsl .FromString (policy )
172
172
if err != nil {
173
- return fmt .Errorf ("Invalid policy %s\n " , policy )
173
+ return fmt .Errorf ("Invalid policy %s" , policy )
174
174
}
175
175
policyMarhsalled = putils .MarshalOrPanic (p )
176
176
} else {
@@ -199,7 +199,7 @@ func checkChaincodeCmdParams(cmd *cobra.Command) error {
199
199
_ , argsPresent := sm ["args" ]
200
200
_ , funcPresent := sm ["function" ]
201
201
if ! argsPresent || (len (m ) == 2 && ! funcPresent ) || len (m ) > 2 {
202
- return fmt . Errorf ("Non-empty JSON chaincode parameters must contain the following keys: 'Args' or 'Function' and 'Args'" )
202
+ return errors . New ("Non-empty JSON chaincode parameters must contain the following keys: 'Args' or 'Function' and 'Args'" )
203
203
}
204
204
} else {
205
205
if cmd == nil || cmd != chaincodeInstallCmd {
0 commit comments