Skip to content

Commit

Permalink
types: justify an ignored error return value
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Jakubowski <[email protected]>
  • Loading branch information
patjakdev committed Nov 12, 2024
1 parent f1b2410 commit 6d7340d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions types/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ func unmarshalExtensionValue[T any](b []byte, extName string, parse func(string)
if res.Extn == nil {
// If we didn't find an Extn, maybe it's just an extn.
var res2 extn

// N.B. we already know that this JSON unmarshals successfully as a struct, so it's
// not actually possible to get an error here. Hence, it's safe to ignore the return
// value.
_ = json.Unmarshal(b, &res2)

// We've tried Ext.Fn and Fn, so no good.
if res2.Fn == "" {
return zeroT, errJSONExtNotFound
Expand Down

0 comments on commit 6d7340d

Please sign in to comment.