-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dean Karn
authored
Mar 11, 2019
1 parent
736ecb5
commit fdcdf50
Showing
29 changed files
with
398 additions
and
924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ _testmain.go | |
*.test | ||
*.prof | ||
old.txt | ||
new.txt | ||
new.txt | ||
*.coverprofile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
GOCMD=GO111MODULE=on go | ||
|
||
lint: | ||
go vet ./... | ||
|
||
test: | ||
$(GOCMD) test -cover -race ./... | ||
|
||
bench: | ||
$(GOCMD) test -run=NONE -bench=. -benchmem ./... | ||
|
||
.PHONY: test lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package log | ||
|
||
import ( | ||
"bytes" | ||
stderr "errors" | ||
"testing" | ||
|
||
"github.com/go-playground/errors" | ||
) | ||
|
||
func BenchmarkWithError(b *testing.B) { | ||
err := stderr.New("new error") | ||
entry := Entry{} | ||
for i := 0; i < b.N; i++ { | ||
_ = errorsWithError(entry, err) | ||
} | ||
} | ||
|
||
func BenchmarkWithErrorParallel(b *testing.B) { | ||
err := stderr.New("new error") | ||
entry := Entry{} | ||
b.RunParallel(func(pb *testing.PB) { | ||
var buf bytes.Buffer | ||
for pb.Next() { | ||
buf.Reset() | ||
_ = errorsWithError(entry, err) | ||
} | ||
}) | ||
} | ||
|
||
func BenchmarkWithErrorExisting(b *testing.B) { | ||
err := errors.New("new error") | ||
entry := Entry{} | ||
for i := 0; i < b.N; i++ { | ||
_ = errorsWithError(entry, err) | ||
} | ||
} | ||
|
||
func BenchmarkWithErrorExistingParallel(b *testing.B) { | ||
err := errors.New("new error") | ||
entry := Entry{} | ||
b.RunParallel(func(pb *testing.PB) { | ||
var buf bytes.Buffer | ||
for pb.Next() { | ||
buf.Reset() | ||
_ = errorsWithError(entry, err) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module github.com/go-playground/log | ||
|
||
go 1.11 | ||
|
||
require ( | ||
github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91 | ||
github.com/go-playground/ansi v2.1.0+incompatible | ||
github.com/go-playground/errors v0.0.0-20190311043724-4050dd2e2e3b | ||
github.com/pkg/errors v0.8.1 | ||
github.com/segmentio/errors-go v1.0.0 | ||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91 h1:vX+gnvBc56EbWYrmlhYbFYRaeikAke1GL84N4BEYOFE= | ||
github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91/go.mod h1:cDLGBht23g0XQdLjzn6xOGXDkLK182YfINAaZEQLCHQ= | ||
github.com/aws/aws-sdk-go v1.17.14/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= | ||
github.com/go-playground/ansi v2.1.0+incompatible h1:f9ldskdk1seTFmYjbmPaYB+WYsDKWc4UXcGb+e9JrN8= | ||
github.com/go-playground/ansi v2.1.0+incompatible/go.mod h1:OCdnfTFO/GfFtp+ktUt+PhElbGOwyTRUuRUsA+Y5pSU= | ||
github.com/go-playground/errors v0.0.0-20190311043724-4050dd2e2e3b h1:kP7Mu+FdZU+aG3BkVe5wM2JP7H0F/uQJfbCsZgcMQPE= | ||
github.com/go-playground/errors v0.0.0-20190311043724-4050dd2e2e3b/go.mod h1:z6q0ljiLHVElL1MHPEMKW+U4THB6xoXSi4GGkc1unu4= | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= | ||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= | ||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
github.com/segmentio/errors-go v1.0.0 h1:B4mbo4hP3+XffV1GhwyAcHlvWoZtYdTyc3BOVPxspTQ= | ||
github.com/segmentio/errors-go v1.0.0/go.mod h1:RDVEREUrpa4/jM8rt5KsQpu+JoXPi6i07vG7m4tX0MY= | ||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= | ||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.