Skip to content

[Enhancement] add cleaner and more efficient error handling #92

@MadhavJivrajani

Description

@MadhavJivrajani

Currenltly, error handling is done in the usual pattern of

err := something()
if err != nil {
    return err // propagate err up the function call chain
}

However, this might not be the most robust and efficient way to do this as mentioned in this super interesting talk.

The main take away from this are that the current versions of Go pass return values around in memory rather than in registers as done by languages like C++. An excellent reference for the same can be found here. Therefore, doing error handling in the above mentioned form may not prove to be as efficient as one might like.

Some discussion might be required in terms of what approaches to use and if we should introduce external dependencies to handle the same, before proceeding with this issue in. Discussion can take place on the Discussions tab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionissue needs to be discussed and decision neeeds to be taken.enhancementNew feature or requestpriority: medium

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions