Skip to content

Abolished github.com/pkg/errors#420

Merged
deepmap-marcinr merged 3 commits intooapi-codegen:masterfrom
Taillook:chore/deprecate-pkg-errors
Aug 23, 2021
Merged

Abolished github.com/pkg/errors#420
deepmap-marcinr merged 3 commits intooapi-codegen:masterfrom
Taillook:chore/deprecate-pkg-errors

Conversation

@Taillook
Copy link
Contributor

Fix for #418
To move github.com/pkg/errors to erros.

@Taillook
Copy link
Contributor Author

Fixed test at #410

object[fieldName], err = json.Marshal(field)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error marshaling '%s'", fieldName))
return nil, fmt.Errorf("error marshaling '%s'", fieldName)
Copy link

Choose a reason for hiding this comment

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

Throughout this change, you're losing the wrapped error. This would be equivalent to the old error:

Suggested change
return nil, fmt.Errorf("error marshaling '%s'", fieldName)
return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, thanks.

@ckarenz
Copy link

ckarenz commented Aug 14, 2021

I might also recommend converting '%s' to %q globally, but that would change output and probably deserves its own discussion and PR.

Copy link

@ckarenz ckarenz left a comment

Choose a reason for hiding this comment

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

Edit: Removed duplicate comment.

@Taillook
Copy link
Contributor Author

Throughout this change, you're losing the wrapped error. This would be equivalent to the old error:

resolved format.

@Taillook
Copy link
Contributor Author

I might also recommend converting '%s' to %q globally, but that would change output and probably deserves its own discussion and PR.

Yes, Not supported here.
(And need many changes...

Copy link

@ckarenz ckarenz left a comment

Choose a reason for hiding this comment

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

Looks great!

@deepmap-marcinr deepmap-marcinr merged commit 5bf9853 into oapi-codegen:master Aug 23, 2021
@Taillook Taillook deleted the chore/deprecate-pkg-errors branch August 24, 2021 09:08
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
* remove github.com/pkg/errors

* `go mod tidy`

* fix losted err wrap
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
* remove github.com/pkg/errors

* `go mod tidy`

* fix losted err wrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants