File: xerrors_test.go

package info (click to toggle)
golang-github-bradenaw-juniper 0.15.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 872 kB
  • sloc: sh: 27; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 285 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package xerrors

import (
	"errors"
	"fmt"
	"strings"
)

func ExampleWithStack() {
	err := WithStack(errors.New("foo"))

	fmt.Println(strings.Join(strings.Split(err.Error(), "\n")[:3], "\n"))

	// Output:
	//
	// foo
	//
	// github.com/bradenaw/juniper/xerrors.ExampleWithStack(...)
}