Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithError ¶
WithError annotates cause error with a new error. If cause is nil, WithError returns new error. If err is nil, WithError returns nil.
Example ¶
package main
import (
"errors"
"fmt"
"github.com/searKing/golang/go/error/cause"
)
func main() {
cause_ := errors.New("whoops")
err := fmt.Errorf("oh noes")
err = cause.WithError(cause_, err)
fmt.Println(err)
}
Output: oh noes: whoops
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.