Skip to content

Commit 29aa4e1

Browse files
author
Dean Karn
authored
Updated to use go-playground/pkg (#9)
The new go-playground/pkg provides that stack and frame information that can now be used without this package.
1 parent 4050dd2 commit 29aa4e1

File tree

8 files changed

+45
-87
lines changed

8 files changed

+45
-87
lines changed

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: go
2+
go:
3+
- 1.12.5
4+
- tip
5+
matrix:
6+
allow_failures:
7+
- go: tip
8+
9+
notifications:
10+
email:
11+
recipients: [email protected]
12+
on_success: change
13+
on_failure: always
14+
15+
before_install:
16+
- go get -u github.com/go-playground/overalls
17+
- go get -u github.com/mattn/goveralls
18+
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.16.0
19+
20+
script:
21+
- make test
22+
- ./bin/golangci-lint run
23+
24+
after_success: |
25+
[ $TRAVIS_GO_VERSION = 1.12.5 ] &&
26+
overalls -project="github.com/go-playground/errors" -covermode=count -ignore=.git,examples -debug &&
27+
goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package errors
22
============
3-
![Project status](https://img.shields.io/badge/version-4.0.0-green.svg)
3+
![Project status](https://img.shields.io/badge/version-5.0.0-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/errors/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/errors)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/errors)](https://goreportcard.com/report/github.com/go-playground/errors)
66
[![GoDoc](https://godoc.org/github.com/go-playground/errors?status.svg)](https://godoc.org/github.com/go-playground/errors)

_examples/stack/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/go-playground/errors"
6+
runtimeext "github.com/go-playground/pkg/runtime"
77
)
88

99
func main() {
1010
// maybe you just want to grab a stack trace and process on your own like go-playground/log
1111
// uses it to produce a stack trace log message
12-
frame := errors.Stack()
12+
frame := runtimeext.Stack()
1313
fmt.Printf("Function: %s File: %s Line: %d\n", frame.Function(), frame.File(), frame.Line())
1414

1515
// and still have access to the underlying runtime.Frame

chain.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"fmt"
55
"strconv"
66
"strings"
7+
8+
runtimeext "github.com/go-playground/pkg/runtime"
79
)
810

911
// T is a shortcut to make a Tag
@@ -22,7 +24,7 @@ func newLink(err error, prefix string, skipFrames int) *Link {
2224
return &Link{
2325
Err: err,
2426
Prefix: prefix,
25-
Source: StackLevel(skipFrames),
27+
Source: runtimeext.StackLevel(skipFrames),
2628
}
2729

2830
}
@@ -61,7 +63,7 @@ type Link struct {
6163
Tags []Tag
6264

6365
// Source contains the name, file and lines obtained from the stack trace
64-
Source Frame
66+
Source runtimeext.Frame
6567
}
6668

6769
// formatError prints a single Links error

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ module github.com/go-playground/errors
22

33
go 1.11
44

5-
require github.com/aws/aws-sdk-go v1.17.14
5+
require (
6+
github.com/aws/aws-sdk-go v1.19.28
7+
github.com/go-playground/pkg v0.0.0-20190511145249-fa4bcb050f1d
8+
)

go.sum

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
github.com/aws/aws-sdk-go v1.17.14 h1:IjqZDIQoLyZ48A93BxVrZOaIGgZPRi4nXt6WQUMJplY=
2-
github.com/aws/aws-sdk-go v1.17.14/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
1+
github.com/aws/aws-sdk-go v1.19.28 h1:u0KMC+Qv0YVyz8YR6mREEtslSPkdUMzXgDJFD5196O8=
2+
github.com/aws/aws-sdk-go v1.19.28/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
3+
github.com/go-playground/form v3.1.4+incompatible/go.mod h1:lhcKXfTuhRtIZCIKUeJ0b5F207aeQCPbZU09ScKjwWg=
4+
github.com/go-playground/pkg v0.0.0-20190511145249-fa4bcb050f1d h1:dLyXECWWFoQAp49e+ayPJyTcVAVOSAEmZ/QALeOuIfg=
5+
github.com/go-playground/pkg v0.0.0-20190511145249-fa4bcb050f1d/go.mod h1:Wg1j+HqWLhhVIfYdaoOuBzdutBEVcqwvBxgFZRWbybk=
6+
github.com/go-playground/pkg v1.0.1 h1:EsBCgjDTrlaLCflFChT2Q/M4unQQS6DnBDvHTA+fVAI=
37
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
8+
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=

stack.go

Lines changed: 0 additions & 47 deletions
This file was deleted.

stack_test.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)