Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic helpers #241

Draft
wants to merge 2 commits into
base: beta_2.0
Choose a base branch
from
Draft

Generic helpers #241

wants to merge 2 commits into from

Conversation

nkxxll
Copy link
Collaborator

@nkxxll nkxxll commented Feb 15, 2024

Ja ich hab mal die zeit genutzt und generische helpers in closures implementiert, das ist noch ein draft. Wenn das was ist das aufgenommen werden soll kann man das in das Projekt zum handeln von errors einbinden.

// error handling now
value, err := funcThatErrors()
if err != nil {
    // handle error
}
// error handling with generic handler
value := handle(funcThatErrors())

Add generic helper functions (closures) that can take a value with a generic type
and an error. If the error is not nil the closure funcition handles the error
and panic in the case of read write or tryes to do a http error and logs the error
in the case of an server error.
@nkxxll
Copy link
Collaborator Author

nkxxll commented Feb 15, 2024

Lol failed weil github action auf go 1.19 ist :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant