Skip to content

Commit

Permalink
test: more coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Shiwei Zhang <[email protected]>
  • Loading branch information
shizhMSFT committed Feb 20, 2023
1 parent e648281 commit ad6c208
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ func deterministicBinaryString(data cbor.RawMessage) (cbor.RawMessage, error) {
}

// slow path: convert by re-encoding
// error checking is not required since `data` has been validataed
var s []byte
if err := decModeWithTagsForbidden.Unmarshal(data, &s); err != nil {
return nil, err
}
_ = decModeWithTagsForbidden.Unmarshal(data, &s)
return encMode.Marshal(s)
}

0 comments on commit ad6c208

Please sign in to comment.