Skip to content

Return actual error types instead of generic + string #269

Open
@drewmullen

Description

@drewmullen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions