err0

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 1 Imported by: 15 modules, 24 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Introduction

The Repo API is from https://github.com/lainio/err2/tree/v0.9.1#error-checks

I like err2 old api, so I create this.

API

package main

import (
	"fmt"

	"github.com/shynome/err0"
	"github.com/shynome/err0/try"
)

func main() {
	var err error
	defer err0.Then(&err, func() {
		fmt.Println("no error", err)
	}, func() {
		fmt.Println("has error", err)
	})
	try.To(fmt.Errorf("hi, error!"))
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Throw = try.To

Functions

func Then added in v0.1.0

func Then(err *error, onok func(), onerr func())

Then only handle try.ToX panic generate error(try.Error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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