diff --git a/.travis.yml b/.travis.yml index 42a68b4..5143ab5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ before_install: - mkdir -p $GOPATH/src/gopkg.in - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/webhooks.v2 - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/webhooks.v3 + - ln -s $GOPATH/src/github.com/$TRAVIS_REPO_SLUG $GOPATH/src/gopkg.in/webhooks.v4 before_script: - go vet ./... @@ -35,4 +36,4 @@ script: after_success: | [ $TRAVIS_GO_VERSION = 1.10.2 ] && overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,examples -debug && - goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN \ No newline at end of file + goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN diff --git a/README.md b/README.md index 52c403d..ab6c3c0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Library webhooks [![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v3)](https://travis-ci.org/go-playground/webhooks) [![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v3&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v3) [![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks) -[![GoDoc](https://godoc.org/gopkg.in/go-playground/webhooks.v3?status.svg)](https://godoc.org/gopkg.in/go-playground/webhooks.v3) +[![GoDoc](https://godoc.org/gopkg.in/go-playground/webhooks.v4?status.svg)](https://godoc.org/gopkg.in/go-playground/webhooks.v4) ![License](https://img.shields.io/dub/l/vibe-d.svg) Library webhooks allows for easy receiving and parsing of GitHub, Bitbucket and GitLab Webhook Events @@ -24,17 +24,17 @@ Installation Use go get. ```shell -go get -u gopkg.in/go-playground/webhooks.v3 +go get -u gopkg.in/go-playground/webhooks.v4 ``` Then import the package into your own code. - import "gopkg.in/go-playground/webhooks.v3" + import "gopkg.in/go-playground/webhooks.v4" Usage and Documentation ------ -Please see http://godoc.org/gopkg.in/go-playground/webhooks.v3 for detailed usage docs. +Please see http://godoc.org/gopkg.in/go-playground/webhooks.v4 for detailed usage docs. ##### Examples: @@ -46,8 +46,8 @@ import ( "fmt" "strconv" - "gopkg.in/go-playground/webhooks.v3" - "gopkg.in/go-playground/webhooks.v3/github" + "gopkg.in/go-playground/webhooks.v4" + "gopkg.in/go-playground/webhooks.v4/github" ) const ( @@ -103,8 +103,8 @@ import ( "fmt" "strconv" - "gopkg.in/go-playground/webhooks.v3" - "gopkg.in/go-playground/webhooks.v3/github" + "gopkg.in/go-playground/webhooks.v4" + "gopkg.in/go-playground/webhooks.v4/github" ) const ( diff --git a/bitbucket/bitbucket.go b/bitbucket/bitbucket.go index 680582b..e296667 100644 --- a/bitbucket/bitbucket.go +++ b/bitbucket/bitbucket.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "net/http" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // Webhook instance contains all methods needed to process events diff --git a/bitbucket/bitbucket_test.go b/bitbucket/bitbucket_test.go index bd7a027..b002eae 100644 --- a/bitbucket/bitbucket_test.go +++ b/bitbucket/bitbucket_test.go @@ -9,7 +9,7 @@ import ( "time" . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // NOTES: diff --git a/examples/custom-logger/main.go b/examples/custom-logger/main.go index 9ebefe1..9a819d6 100644 --- a/examples/custom-logger/main.go +++ b/examples/custom-logger/main.go @@ -5,8 +5,8 @@ import ( "log" "strconv" - "gopkg.in/go-playground/webhooks.v3" - "gopkg.in/go-playground/webhooks.v3/github" + "gopkg.in/go-playground/webhooks.v4" + "gopkg.in/go-playground/webhooks.v4/github" ) const ( @@ -18,15 +18,15 @@ type myLogger struct { PrintDebugs bool } -func (l *myLogger) Info(msg string) { +func (l *myLogger) Info(msg ...interface{}) { log.Println(msg) } -func (l *myLogger) Error(msg string) { +func (l *myLogger) Error(msg ...interface{}) { log.Println(msg) } -func (l *myLogger) Debug(msg string) { +func (l *myLogger) Debug(msg ...interface{}) { if !l.PrintDebugs { return } diff --git a/examples/multiple-handlers/main.go b/examples/multiple-handlers/main.go index ca40d9a..5b4b85e 100644 --- a/examples/multiple-handlers/main.go +++ b/examples/multiple-handlers/main.go @@ -4,8 +4,8 @@ import ( "fmt" "strconv" - "gopkg.in/go-playground/webhooks.v3" - "gopkg.in/go-playground/webhooks.v3/github" + "gopkg.in/go-playground/webhooks.v4" + "gopkg.in/go-playground/webhooks.v4/github" ) const ( diff --git a/examples/single-handler/main.go b/examples/single-handler/main.go index 491a517..667d63d 100644 --- a/examples/single-handler/main.go +++ b/examples/single-handler/main.go @@ -4,8 +4,8 @@ import ( "fmt" "strconv" - "gopkg.in/go-playground/webhooks.v3" - "gopkg.in/go-playground/webhooks.v3/github" + "gopkg.in/go-playground/webhooks.v4" + "gopkg.in/go-playground/webhooks.v4/github" ) const ( diff --git a/github/github.go b/github/github.go index 2b5c933..656dbc7 100644 --- a/github/github.go +++ b/github/github.go @@ -9,7 +9,7 @@ import ( "io/ioutil" "net/http" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // Webhook instance contains all methods needed to process events diff --git a/github/github_test.go b/github/github_test.go index af606ca..4ea94cc 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -9,7 +9,7 @@ import ( "time" . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // NOTES: diff --git a/gitlab/gitlab.go b/gitlab/gitlab.go index cac3a3e..4bdc6df 100644 --- a/gitlab/gitlab.go +++ b/gitlab/gitlab.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "net/http" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // Webhook instance contains all methods needed to process events diff --git a/gitlab/gitlab_test.go b/gitlab/gitlab_test.go index a2be2aa..be916d3 100644 --- a/gitlab/gitlab_test.go +++ b/gitlab/gitlab_test.go @@ -9,7 +9,7 @@ import ( "time" . "gopkg.in/go-playground/assert.v1" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // NOTES: @@ -945,7 +945,7 @@ func TestMergeRequestEvent(t *testing.T) { }] } } - } + } ` req, err := http.NewRequest("POST", "http://127.0.0.1:3011/webhooks", bytes.NewBuffer([]byte(payload))) diff --git a/gogs/gogs.go b/gogs/gogs.go index d5d57da..28398f8 100644 --- a/gogs/gogs.go +++ b/gogs/gogs.go @@ -10,7 +10,7 @@ import ( "crypto/sha256" "encoding/hex" client "github.com/gogits/go-gogs-client" - "gopkg.in/go-playground/webhooks.v3" + "gopkg.in/go-playground/webhooks.v4" ) // Webhook instance contains all methods needed to process events diff --git a/logger.go b/logger.go index 0d3d588..56eba3a 100644 --- a/logger.go +++ b/logger.go @@ -9,11 +9,11 @@ var DefaultLog Logger = new(logger) // Logger allows for customizable logging type Logger interface { // Info prints basic information. - Info(string) + Info(...interface{}) // Error prints error information. - Error(string) + Error(...interface{}) // Debug prints information usefull for debugging. - Debug(string) + Debug(...interface{}) } // NewLogger returns a new logger for use. @@ -26,17 +26,17 @@ type logger struct { } // Info prints basic information. -func (l *logger) Info(msg string) { +func (l *logger) Info(msg ...interface{}) { log.Println("INFO:", msg) } // v prints error information. -func (l *logger) Error(msg string) { +func (l *logger) Error(msg ...interface{}) { log.Println("ERROR:", msg) } // Debug prints information usefull for debugging. -func (l *logger) Debug(msg string) { +func (l *logger) Debug(msg ...interface{}) { if !l.PrintDebugs { return }