Skip to content

Commit

Permalink
Fix Go lint errors (#144)
Browse files Browse the repository at this point in the history
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart authored Aug 14, 2024
1 parent 9dc3120 commit d4eba5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/functionaltests/step_definitions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func iHaveCreatedChaincodeFrom(ctx context.Context, name string) (context.Contex

chaincode, err := contractapi.NewChaincode(contractsMap[name])
if err != nil {
return ctx, fmt.Errorf("expected to get nil for error on create chaincode but got " + err.Error())
return ctx, fmt.Errorf("expected to get nil for error on create chaincode but got %s", err.Error())
}

sc := suiteContext{}
Expand Down Expand Up @@ -107,7 +107,7 @@ func iHaveCreatedChaincodeFromMultipleContracts(ctx context.Context, contractsTb
chaincode, err := contractapi.NewChaincode(contracts...)

if err != nil {
return ctx, fmt.Errorf("expected to get nil for error on create chaincode but got " + err.Error())
return ctx, fmt.Errorf("expected to get nil for error on create chaincode but got %s", err.Error())
}
sc := suiteContext{}
sc.chaincode = chaincode
Expand All @@ -128,7 +128,7 @@ func iShouldBeAbleToInitialiseTheChaincode(ctx context.Context) (context.Context
sc.stub.MockTransactionEnd(txID)

if response.GetStatus() != int32(200) {
return ctx, fmt.Errorf("expected to get status 200 on init but got " + strconv.Itoa(int(response.GetStatus())))
return ctx, fmt.Errorf("expected to get status 200 on init but got %s", strconv.Itoa(int(response.GetStatus())))
}

return context.WithValue(ctx, suiteContextKey{}, sc), nil
Expand All @@ -142,7 +142,7 @@ func iShouldReceiveASuccessfulResponse(ctx context.Context, result string) (cont

payload := string(sc.lastResponse.GetPayload())
if result != "" && payload != result {
return ctx, fmt.Errorf("expected to get payload :" + result + ": but got :" + payload + ":")
return ctx, fmt.Errorf(`expected to get payload "%s" but got "%s"`, result, payload)
}

return ctx, nil
Expand Down Expand Up @@ -235,7 +235,7 @@ func iShouldReceiveAnUnsuccessfulResponse(ctx context.Context, result string) (c

message := sc.lastResponse.GetMessage()
if result != "" && message != result {
return ctx, fmt.Errorf("expected to get message " + result + " but got " + message)
return ctx, fmt.Errorf(`expected to get message "%s" but got "%s"`, result, message)
}
return ctx, nil
}
Expand Down

0 comments on commit d4eba5b

Please sign in to comment.