-
Type: Story
-
Status: To Do (View Workflow)
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Future
-
Component/s: ofagent-go, openolt-adapter, openonu-adapter, rw-core
-
Labels:
-
Story Points:8
In go version 1.13, error wrapping/unwrapping was introduced. Since then it has become a best practice to wrap an error when a function catches and error and passes it on.
Ex:
result, err := pkg.SomeFunction() if err != nil { return err }
becomes something like
result, err := pkg.SomeFunction() if err != nil { return fmt.Errorf("added context: %w", err) }