Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Go lint errors #144

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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