Skip to content

Commit

Permalink
Add comment to order.Side.UnmarshalJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Sep 11, 2023
1 parent da419f8 commit 27d369f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exchanges/order/orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,8 @@ func StringToOrderSide(side string) (Side, error) {
}
}

// UnmarshalJSON parses the JSON-encoded order side and stores the result
// It expects a quoted string input, and uses StringToOrderSide to parse it
func (s *Side) UnmarshalJSON(data []byte) (err error) {
if !bytes.HasPrefix(data, []byte(`"`)) {
// Note that we don't need to worry about invalid JSON here, it wouldn't have made it past the deserialiser far
Expand Down

0 comments on commit 27d369f

Please sign in to comment.