diff --git a/cmd/kosli/attestation.go b/cmd/kosli/attestation.go index d7fe697ad..bb96c728b 100644 --- a/cmd/kosli/attestation.go +++ b/cmd/kosli/attestation.go @@ -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 diff --git a/cmd/kosli/cli_utils.go b/cmd/kosli/cli_utils.go index 1fdd58ef2..dd35ce76b 100644 --- a/cmd/kosli/cli_utils.go +++ b/cmd/kosli/cli_utils.go @@ -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] == "" { diff --git a/internal/sonar/sonar.go b/internal/sonar/sonar.go index d8f83aaa7..fe381907a 100644 --- a/internal/sonar/sonar.go +++ b/internal/sonar/sonar.go @@ -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