Skip to content

Commit

Permalink
chore: Fix lint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Jan 15, 2025
1 parent 2181d23 commit bf36726
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/eksctl/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func dumpLogsToDisk(logBuffer *bytes.Buffer, errorString string) error {
if _, err := os.Stat("logs/"); os.IsNotExist(err) {

if err := os.Mkdir("logs/", 0755); err != nil {
return fmt.Errorf(err.Error())
return fmt.Errorf("%s", err.Error())
}
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/actions/accessentry/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package accessentry

import (
"context"
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -136,7 +137,7 @@ func runAllTasks(taskTree *tasks.TaskTree) error {
for _, err := range errs {
allErrs = append(allErrs, err.Error())
}
return fmt.Errorf(strings.Join(allErrs, "\n"))
return errors.New(strings.Join(allErrs, "\n"))
}
completedAction := func() string {
if taskTree.PlanMode {
Expand Down
3 changes: 2 additions & 1 deletion pkg/actions/addon/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package addon

import (
"context"
"errors"
"fmt"
"slices"
"strings"
Expand Down Expand Up @@ -221,7 +222,7 @@ func runAllTasks(taskTree *tasks.TaskTree) error {
for _, err := range errs {
allErrs = append(allErrs, err.Error())
}
return fmt.Errorf(strings.Join(allErrs, "\n"))
return errors.New(strings.Join(allErrs, "\n"))
}
completedAction := func() string {
if taskTree.PlanMode {
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/anywhere/anywhere.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func IsAnywhereCommand(args []string) (bool, error) {
// RunAnywhereCommand executes the anywhere binary.
func RunAnywhereCommand(args []string) (int, error) {
if _, err := exec.LookPath(BinaryFileName); errors.Is(err, exec.ErrNotFound) {
return 1, fmt.Errorf(fmt.Sprintf("%q plugin was not found on your path", BinaryFileName))
return 1, fmt.Errorf("%q plugin was not found on your path", BinaryFileName)
} else if err != nil {
return 1, fmt.Errorf("failed to lookup anywhere plugin: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/podidentityassociation/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func runAllTasks(taskTree *tasks.TaskTree) error {
for _, err := range errs {
allErrs = append(allErrs, err.Error())
}
return fmt.Errorf(strings.Join(allErrs, "\n"))
return errors.New(strings.Join(allErrs, "\n"))
}
completedAction := func() string {
if taskTree.PlanMode {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cfn/template/matchers/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package template

import (
"encoding/json"
"errors"
"fmt"
"os"

Expand Down Expand Up @@ -366,7 +367,7 @@ func (m *commonMatcher) matchJSON(actual interface{}, js []byte) (bool, error) {
return false, nil
}
if !ok {
m.err = fmt.Errorf(jsMatcher.FailureMessage(js))
m.err = errors.New(jsMatcher.FailureMessage(js))
}
return ok, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ssh/client/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func findKeyInEC2(ctx context.Context, ec2API awsapi.EC2, name string) (*ec2type
if errors.As(err, &ae) && ae.ErrorCode() == "InvalidKeyPair.NotFound" {
return nil, nil
}
return nil, errors.Wrapf(err, fmt.Sprintf("searching for SSH public key %q in EC2", name))
return nil, errors.Wrap(err, fmt.Sprintf("searching for SSH public key %q in EC2", name))
}

if len(output.KeyPairs) != 1 {
Expand Down

0 comments on commit bf36726

Please sign in to comment.