Esempio n. 1
0
func ExampleFprint() {
	err := fn()
	errors.Fprint(os.Stdout, err)

	// Output: github.com/pkg/errors/example_test.go:36: outer
	// github.com/pkg/errors/example_test.go:35: middle
	// github.com/pkg/errors/example_test.go:34: inner
	// github.com/pkg/errors/example_test.go:33: error
}
Esempio n. 2
0
func ExampleErrorf() {
	err := errors.Errorf("whoops: %s", "foo")
	errors.Fprint(os.Stdout, err)

	// Output: github.com/pkg/errors/example_test.go:67: whoops: foo
}
Esempio n. 3
0
func ExampleNew_fprint() {
	err := errors.New("whoops")
	errors.Fprint(os.Stdout, err)

	// Output: github.com/pkg/errors/example_test.go:18: whoops
}