alpacahq / alpacahq/alpaca-trade-api-go

Return actual error types instead of generic + string

Open
#269 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
429
Forks
118
PR merge metrics
No merged PRs in 30d

Description

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()`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.