multi: fix fmt.Errorf error wrapping

Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
This commit is contained in:
ffranr committed 2024-02-27 11:13:40 +00:00
1 parent 581c16d72f
commit cd566eb097
103 files changed
+426 -390

No files matched your search

+2 -2
View File
@@ -245,7 +245,7 @@ func (nw *nodeWatcher) WaitForChannelPolicyUpdate(
case <-timer:
expected, err := json.MarshalIndent(policy, "", "\t")
if err != nil {
return fmt.Errorf("encode policy err: %v", err)
return fmt.Errorf("encode policy err: %w", err)
}
policies, err := syncMapToJSON(
&nw.state.policyUpdates.Map,
@@ -274,7 +274,7 @@ func syncMapToJSON(state *sync.Map) ([]byte, error) {
})
policies, err := json.MarshalIndent(m, "", "\t")
if err != nil {
return nil, fmt.Errorf("encode polices err: %v", err)
return nil, fmt.Errorf("encode polices err: %w", err)
}
return policies, nil