errs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 5 Imported by: 0

README

サンプルリスト

このディレクトリには以下のサンプルがあります。

file example name note
error_basic.go error_basic error のハンドリングについてのサンプル
error_sentinel.go error_sentinel Goにおけるエラー処理イディオムの sentinel error check についてのサンプルです.
error_typeassertion.go error_typeassertion Goにおけるエラー処理イディオムの type assertion check についてのサンプルです.
error_wrap_unwrap.go error_wrap_unwrap Goにおけるエラー処理にてエラーを内包するやり方についてのサンプルです。

Documentation

Overview

Package errs -- エラーについてのサンプルが配置されているパッケージです。

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSentinel -- sentinel error check
	ErrSentinel = errors.New("example: sentinel error check")
)

Functions

func NewRegister

func NewRegister() mapping.Register

NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。

func Sentinel

func Sentinel() error

Sentinel は、Goにおけるエラー処理イディオムの sentinel error check についてのサンプルです. REFERENCES::

func TypeAssertion

func TypeAssertion() error

TypeAssertion は、Goにおけるエラー処理イディオムの type assertion check についてのサンプルです. REFERENCES::

func WrapAndUnwrap

func WrapAndUnwrap() error

WrapAndUnwrap は、Goにおけるエラー処理にてエラーを内包するやり方についてのサンプルです。 REFERENCES::

Types

type TypeAssertionError

type TypeAssertionError struct{}

TypeAssertionError -- type assertion check

func (*TypeAssertionError) Error

func (t *TypeAssertionError) Error() string

type WrapError

type WrapError struct {
	InnerError error
}

WrapError -- wrap error object

func (*WrapError) Error

func (w *WrapError) Error() string

func (*WrapError) Unwrap

func (w *WrapError) Unwrap() error

Unwrap -- 内包しているエラーを返します。

Jump to

Keyboard shortcuts

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