fail

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2025 License: AGPL-3.0 Imports: 0 Imported by: 0

README

Go Fail

Go Report Card AGPLv3 pkg.go.dev

This module contains two generic functions to handle program failure.

Documentation

Overview

Package fail provides function to handle program failures in case of errors.

Index

Examples

Constants

This section is empty.

Variables

View Source
var Fail = func(err error) { panic(err) }

The function gets called in case of an failure.

Functions

func F0

func F0(err error)

Fail in case of an error.

Example
Fail = func(err error) { log.Fatal(err) }
F0(os.Setenv("", ""))

func F1

func F1[R any](result R, err error) R

Fail in case of an error otherwise return the result.

Example
Fail = func(err error) { log.Fatal(err) }
data := F1[[]byte](os.ReadFile("."))
println(data)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL