Skip to content

all: remove use of pkg/errors and replace with standard library#101

Merged
efd6 merged 1 commit intoelastic:mainfrom
efd6:removepkgerrors
Feb 3, 2022
Merged

all: remove use of pkg/errors and replace with standard library#101
efd6 merged 1 commit intoelastic:mainfrom
efd6:removepkgerrors

Conversation

@efd6
Copy link
Copy Markdown
Contributor

@efd6 efd6 commented Feb 3, 2022

Please take a look.

I'd like to have #92 merged before this since this is much easier to replay safely in case of conflict than that is.

Closes #99.

@efd6 efd6 added enhancement Team:Security-External Integrations Label for the Security External Integrations team labels Feb 3, 2022
@efd6 efd6 requested review from adriansr and andrewkroh February 3, 2022 01:51
@elasticmachine
Copy link
Copy Markdown
Collaborator

elasticmachine commented Feb 3, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Reason: null

  • Start Time: 2022-02-03T10:59:33.433+0000

  • Duration: 16 min 25 sec

  • Commit: e855d0a

Test stats 🧪

Test Results
Failed 0
Passed 367
Skipped 40
Total 407

@efd6 efd6 force-pushed the removepkgerrors branch 2 times, most recently from ecceb3c to b071ff6 Compare February 3, 2022 06:35
Copy link
Copy Markdown
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

git-generate script assumes GNU sed.

[git-generate]
echo 1.17.6 > .go-version
gofmt -w -r 'errors.Errorf -> fmt.Errorf' .
gofmt -w -r 'errors.Wrap(e, m) -> fmt.Errorf(m+": %w", e)' .
gofmt -w -r 'errors.Wrapf(e, m) -> fmt.Errorf(m+": %w", e)' .
gofmt -w -r 'errors.Wrapf(e, m, a) -> fmt.Errorf(m+": %w", a, e)' .
gofmt -w -r 'errors.Wrapf(e, m, a, b) -> fmt.Errorf(m+": %w", a, b, e)' .
gofmt -w -r 'errors.Cause(e) != t -> !errors.Is(e, t)' .
find . -name '*.go' -exec sed -i -e 's/"+": %w",/: %w",/g' '{}' \;
find . -name '*.go' -exec sed -i -e 's!"github.com/pkg/errors"$!"errors"!g' '{}' \;
find . -name '*.go' -exec sed -i -e '1h;2,$H;$!d;g' -e 's/"+\n\t*": %w/: %w/g' '{}' \;
goimports -w .
go mod tidy
gofumpt -w .
@efd6 efd6 merged commit e2af1be into elastic:main Feb 3, 2022
renini pushed a commit to renini/go-libaudit that referenced this pull request Jun 26, 2024
git-generate script assumes GNU sed.

[git-generate]
echo 1.17.6 > .go-version
gofmt -w -r 'errors.Errorf -> fmt.Errorf' .
gofmt -w -r 'errors.Wrap(e, m) -> fmt.Errorf(m+": %w", e)' .
gofmt -w -r 'errors.Wrapf(e, m) -> fmt.Errorf(m+": %w", e)' .
gofmt -w -r 'errors.Wrapf(e, m, a) -> fmt.Errorf(m+": %w", a, e)' .
gofmt -w -r 'errors.Wrapf(e, m, a, b) -> fmt.Errorf(m+": %w", a, b, e)' .
gofmt -w -r 'errors.Cause(e) != t -> !errors.Is(e, t)' .
find . -name '*.go' -exec sed -i -e 's/"+": %w",/: %w",/g' '{}' \;
find . -name '*.go' -exec sed -i -e 's!"github.com/pkg/errors"$!"errors"!g' '{}' \;
find . -name '*.go' -exec sed -i -e '1h;2,$H;$!d;g' -e 's/"+\n\t*": %w/: %w/g' '{}' \;
goimports -w .
go mod tidy
gofumpt -w .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Team:Security-External Integrations Label for the Security External Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove usage of github.com/pkg/errors

3 participants