Skip to content

Nil check error in diag.FromErr#488

Open
magodo wants to merge 1 commit into
hashicorp:mainfrom
magodo:diag_nil_err
Open

Nil check error in diag.FromErr#488
magodo wants to merge 1 commit into
hashicorp:mainfrom
magodo:diag_nil_err

Conversation

@magodo

@magodo magodo commented Jul 7, 2020

Copy link
Copy Markdown

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

appilon commented Jul 15, 2020

Copy link
Copy Markdown
Contributor

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

hashicorp-cla commented Mar 12, 2022

Copy link
Copy Markdown

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.

4 participants