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

Nil check error in diag.FromErr #488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

magodo
Copy link

@magodo magodo commented Jul 7, 2020

This allows following use cases:

func foo() error {
    //...
}

func bar() diag.diagnostics {
    //...
    return diag.FromErr(foo())
}

This allows following use cases:

```go
func foo() error {
    //...
}
t p
func bar() diag.diagnostics {
    //...
    return diag.FromErr(foo())
}
```
@paddycarver paddycarver added this to the v2.x (next minor) milestone Jul 10, 2020
@paddycarver paddycarver added the enhancement New feature or request label Jul 10, 2020
@appilon
Copy link
Contributor

appilon commented Jul 15, 2020

I may have approved a little too quickly, it is something we are aware of but we recently moved away from a similar pattern in #199 as it can lead developers to subtle bugs.

@paddycarver paddycarver added the subsystem/diagnostics Issues and feature requests related to the diagnostics returned to core. label Dec 17, 2020
@paddycarver paddycarver removed this from the v2.x (next minor) milestone Dec 17, 2020
Base automatically changed from master to main March 22, 2021 14:01
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request subsystem/diagnostics Issues and feature requests related to the diagnostics returned to core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants