diff --git a/pkg/command/credential_supported.go b/pkg/command/credential_supported.go index b86c18aca..c973211a6 100644 --- a/pkg/command/credential_supported.go +++ b/pkg/command/credential_supported.go @@ -14,17 +14,17 @@ func ForUser(cmd *exec.Cmd, userName string) error { // Look up the user's UID and GID u, err := user.Lookup(userName) if err != nil { - return fmt.Errorf("failed to look up user %s: %v", userName, err) + return fmt.Errorf("failed to look up user %s: %w", userName, err) } uid, err := strconv.Atoi(u.Uid) if err != nil { - return fmt.Errorf("invalid UID %s: %v", u.Uid, err) + return fmt.Errorf("invalid UID %s: %w", u.Uid, err) } gid, err := strconv.Atoi(u.Gid) if err != nil { - return fmt.Errorf("invalid GID %s: %v", u.Gid, err) + return fmt.Errorf("invalid GID %s: %w", u.Gid, err) } // Set the user cmd should run as diff --git a/pkg/survey/survey.go b/pkg/survey/survey.go index 0577b3884..5868d73e3 100644 --- a/pkg/survey/survey.go +++ b/pkg/survey/survey.go @@ -122,7 +122,7 @@ func buildValidator(params *QuestionOptions, compiledRegex *regexp.Regexp) func( return errors.New(params.ValidationMessage) } - return fmt.Errorf("%v", err) + return err } } diff --git a/pkg/util/hash/hash.go b/pkg/util/hash/hash.go index 8660a1764..ccc5ce838 100644 --- a/pkg/util/hash/hash.go +++ b/pkg/util/hash/hash.go @@ -217,7 +217,7 @@ func (w *fileWalker) shouldSkipPath(relFilePath string) (bool, error) { skip, err := w.pm.MatchesOrParentMatches(relFilePath) if err != nil { - return false, fmt.Errorf("failed to match %s: %v", relFilePath, err) + return false, fmt.Errorf("failed to match %s: %w", relFilePath, err) } return skip, nil