Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in gqlerror.List.As() #281

Closed
Metamogul opened this issue Sep 14, 2023 · 0 comments
Closed

Bug in gqlerror.List.As() #281

Metamogul opened this issue Sep 14, 2023 · 0 comments

Comments

@Metamogul
Copy link
Contributor

Metamogul commented Sep 14, 2023

What happened?

When func (errs List) As(target interface{}) bool in gqlerror/error.go:100 is called, the target out argument is passed as pointer to errors.As() for each list element.

What did you expect?

To work as expected when being called from inside errors.As() and return the first instance matching the type of the target parameter, errors.As() has to be called with target, not &target.

Versions

v 2.5.9

Cause

The recent commit 450a0ee introduced this bug.

@Metamogul Metamogul changed the title Bug introduced in 450a0eed Bug in Error.As() Sep 14, 2023
@Metamogul Metamogul changed the title Bug in Error.As() Bug in gqlerror.List.As() Sep 14, 2023
StevenACoffman pushed a commit that referenced this issue Sep 15, 2023
Co-authored-by: Jan Zombik <jan.m.zombik@gmail.com>
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

No branches or pull requests

2 participants