refactor: use std errors#609
Conversation
➖ Are we earthbuild yet?No change in "earthly" occurrences 📈 Overall Progress
Keep up the great work migrating from Earthly to Earthbuild! 🚀 💡 Tips for finding more occurrencesRun locally to see detailed breakdown: ./.github/scripts/count-earthly.shNote that the goal is not to reach 0. |
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase to replace the third-party github.com/pkg/errors package with the Go standard library's errors and fmt packages, utilizing fmt.Errorf with %w for error wrapping and errors.Join for combining errors. The review feedback highlights a critical compilation error in ls_cmds.go due to the use of a non-existent errors.AsType function. Additionally, the feedback points out several instances of redundant or duplicate error wrapping, such as wrapping the same error twice in bootstrap_cmds.go, string concatenation inside fmt.Errorf in git.go, and duplicating the error message in shell_shared.go by both formatting and wrapping the error.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This PR migrates error handling from archived third-party dependencies (
github.com/pkg/errorsandgithub.com/hashicorp/go-multierror) to Go standard library patterns.Changes
pkg/errorswith standard library"errors"and"fmt"(%wwrapping anderrors.AsType).go-multierrorwith standarderrors.Join.cmd/earthly/app/run.go.WriterSubstruct layout to reduce GC scan overhead (pointer bytes down to 40) and resolved style lints.go.modandgo.sum.