1
0
mirror of https://github.com/Luzifer/promcertcheck.git synced 2024-09-20 09:52:57 +00:00
promcertcheck/vendor/github.com/juju/errors/example_test.go
Knut Ahlers 2f67c05f2e
Force latest version of pongo2
v3 has a bug with sorted keyword

Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-11-05 16:50:25 +01:00

24 lines
480 B
Go

// Copyright 2013, 2014 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package errors_test
import (
"fmt"
"github.com/juju/errors"
)
func ExampleTrace() {
var err1 error = fmt.Errorf("something wicked this way comes")
var err2 error = nil
// Tracing a non nil error will return an error
fmt.Println(errors.Trace(err1))
// Tracing nil will return nil
fmt.Println(errors.Trace(err2))
// Output: something wicked this way comes
// <nil>
}