You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
idiomatic go suggests you should pass an specific error type instead of just a string. For example, if i query for a ticker position and dont have one, you should return ErrPositionNotExist, not a string.
example, return something like this: var ErrPositionNotExistForTicker = errors.New("position does not exist")
then i can check with error.Is()
The text was updated successfully, but these errors were encountered:
drewmullen
changed the title
Documentation Request - What are the various codes that can be returned by GetPositions()
Documentation Request - What are the various codes that can be returned by GetPosition()
Jan 16, 2024
drewmullen
changed the title
Documentation Request - What are the various codes that can be returned by GetPosition()
Return actual error types instead of generic + string
Jan 16, 2024
idiomatic go suggests you should pass an specific error type instead of just a string. For example, if i query for a ticker position and dont have one, you should return
ErrPositionNotExist
, not a string.example, return something like this:
var ErrPositionNotExistForTicker = errors.New("position does not exist")
then i can check with
error.Is()
The text was updated successfully, but these errors were encountered: