Skip to content

Commit

Permalink
Fixed lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ToreMerkely committed Aug 26, 2024
1 parent 4dc142a commit fadc718
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/kosli/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func newAttestationForm(payload interface{}, attachments []string) (

func wrapAttestationError(err error) error {
if err != nil {
return fmt.Errorf(strings.Replace(err.Error(), "requires at least one of: artifact_fingerprint or git_commit_info.",
return fmt.Errorf("%s", strings.Replace(err.Error(), "requires at least one of: artifact_fingerprint or git_commit_info.",
"requires at least one of: specifying the fingerprint (either by calculating it using the artifact name/path and --artifact-type, or by providing it using --fingerprint) or providing --commit (requires an available git repo to access commit details)", 1))
}
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/kosli/cli_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func ValidateArtifactArg(args []string, artifactType, inputSha256 string, always
if argsWithLeadingSpace {
errMsg = append(errMsg, "Arguments with a leading space are probably caused by a lone backslash that has a space after it.")
}
return fmt.Errorf(strings.Join(errMsg, "\n"))
return fmt.Errorf("%s", strings.Join(errMsg, "\n"))
}

if len(args) == 0 || args[0] == "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/requests/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (c *Client) Do(p *RequestParams) (*HTTPResponse, error) {
cleanedErrorMessage = fmt.Sprintf("%s", respBodyMap)
}
}
return nil, fmt.Errorf(cleanedErrorMessage)
return nil, fmt.Errorf("%s", cleanedErrorMessage)
}
return &HTTPResponse{string(body), resp}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/sonar/sonar.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (sc *SonarConfig) GetSonarResults() (*SonarResults, error) {
message = fmt.Sprintf("%s\n", message)
}
}
return nil, fmt.Errorf(message)
return nil, fmt.Errorf("%s", message)
}

return sonarResult, nil
Expand Down

0 comments on commit fadc718

Please sign in to comment.