fix: resolve remaining staticcheck linting issues

- Remove newline characters from error messages in step.go
- Change capitalized error messages to lowercase in multienv_step_runner.go and github_client.go
This commit is contained in:
PePe Amengual
2025-06-27 12:22:14 -07:00
parent d13bb002b3
commit 02ffb41cd6
3 changed files with 5 additions and 5 deletions

View File

@@ -211,12 +211,12 @@ func (s Step) Validate() error {
case []interface{}:
for _, e := range t {
if _, ok := e.(string); !ok {
return fmt.Errorf("%q step %q option must contain only strings, found %v\n",
return fmt.Errorf("%q step %q option must contain only strings, found %v",
stepName, ShellArgsArgKey, e)
}
}
default:
return fmt.Errorf("%q step %q option must be a string or a list of strings, found %v\n",
return fmt.Errorf("%q step %q option must be a string or a list of strings, found %v",
stepName, ShellArgsArgKey, t)
}
delete(argMap, ShellArgsArgKey)

View File

@@ -37,7 +37,7 @@ func (r *MultiEnvStepRunner) Run(
vars, err := parseMultienvLine(res)
if err != nil {
return "", fmt.Errorf("Invalid environment variable definition: %s (%w)", res, err)
return "", fmt.Errorf("invalid environment variable definition: %s (%w)", res, err)
}
for i := 0; i < len(vars); i += 2 {

View File

@@ -966,11 +966,11 @@ func (g *GithubClient) MergePull(logger logging.SimpleLogging, pull models.PullR
isMethodAllowed, isMethodExist := mergeMethodsAllow[method]
if !isMethodExist {
return fmt.Errorf("Merge method '%s' is unknown. Specify one of the valid values: '%s'", method, strings.Join(mergeMethodsName, ", "))
return fmt.Errorf("merge method '%s' is unknown. Specify one of the valid values: '%s'", method, strings.Join(mergeMethodsName, ", "))
}
if !isMethodAllowed() {
return fmt.Errorf("Merge method '%s' is not allowed by the repository Pull Request settings", method)
return fmt.Errorf("merge method '%s' is not allowed by the repository Pull Request settings", method)
}
} else {
method = defaultMergeMethod