Skip to content

proposal: errors/result:  #54589

Closed as not planned
Closed as not planned
@MikhailBatsin-code

Description

@MikhailBatsin-code

Add a "Result" structure for handling errors like in rust or make it built-in.

why?

Lots of people consider go-way error handling very annoying and inconvenient, so there must be something that will make error handling in go better.

Solution(for full implementation check out my repository)

make a Result struct:

type Result[T any] struct {
    // must be private
    ok T
    err error
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions