gitea/vendor/github.com/go-stack/stack
Antoine GIRARD c4d8d53a6d Backport: Use vendored go-swagger (#8087) (#8165)
* Use vendored go-swagger (#8087)

* Use vendored go-swagger

* vendor go-swagger

* revert un wanteed change

* remove un-needed GO111MODULE

* Update Makefile

Co-Authored-By: techknowlogick <matti@mdranta.net>

* re-generate swagger file
2019-09-12 22:58:09 +03:00
..
.travis.yml Backport: Use vendored go-swagger (#8087) (#8165) 2019-09-12 22:58:09 +03:00
LICENSE.md Backport: Use vendored go-swagger (#8087) (#8165) 2019-09-12 22:58:09 +03:00
README.md Backport: Use vendored go-swagger (#8087) (#8165) 2019-09-12 22:58:09 +03:00
go.mod Backport: Use vendored go-swagger (#8087) (#8165) 2019-09-12 22:58:09 +03:00
stack.go Backport: Use vendored go-swagger (#8087) (#8165) 2019-09-12 22:58:09 +03:00

README.md

GoDoc Go Report Card TravisCI Coverage Status

stack

Package stack implements utilities to capture, manipulate, and format call stacks. It provides a simpler API than package runtime.

The implementation takes care of the minutia and special cases of interpreting the program counter (pc) values returned by runtime.Callers.

Versioning

Package stack publishes releases via semver compatible Git tags prefixed with a single 'v'. The master branch always contains the latest release. The develop branch contains unreleased commits.

Formatting

Package stack's types implement fmt.Formatter, which provides a simple and flexible way to declaratively configure formatting when used with logging or error tracking packages.

func DoTheThing() {
    c := stack.Caller(0)
    log.Print(c)          // "source.go:10"
    log.Printf("%+v", c)  // "pkg/path/source.go:10"
    log.Printf("%n", c)   // "DoTheThing"

    s := stack.Trace().TrimRuntime()
    log.Print(s)          // "[source.go:15 caller.go:42 main.go:14]"
}

See the docs for all of the supported formatting options.