diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2b2d30d..8b055c7 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -custom: https://tonicpow.com/?af=tonicpow-go +custom: https://tonicpow.com/?af=go-tonicpow diff --git a/CODE_STANDARDS.md b/CODE_STANDARDS.md index 3bbddcb..03035db 100644 --- a/CODE_STANDARDS.md +++ b/CODE_STANDARDS.md @@ -20,7 +20,7 @@ The package [golint](https://github.com/golang/lint) differs from [gofmt](https: How to install [golint](https://github.com/golang/lint): ```bash $ go get -u golang.org/x/lint/golint -$ cd ../tonicpow-go +$ cd ../go-tonicpow $ golint ``` @@ -29,7 +29,7 @@ $ golint How to run [vet](https://golang.org/cmd/vet/): ```bash -$ cd ../tonicpow-go +$ cd ../go-tonicpow $ go vet -v ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11b4b88..55f6be8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,4 +15,4 @@ This project follows [effective Go standards](https://golang.org/doc/effective_g - [godoc](https://godoc.org/golang.org/x/tools/cmd/godoc) - [golint](https://github.com/golang/lint) - [vet](https://golang.org/cmd/vet/) -- [GoReportCard.com](https://goreportcard.com/report/github.com/tonicpow/tonicpow-go) \ No newline at end of file +- [GoReportCard.com](https://goreportcard.com/report/github.com/tonicpow/go-tonicpow) \ No newline at end of file diff --git a/README.md b/README.md index 9e74e21..4d719df 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# tonicpow-go -**tonicpow-go** is the official golang implementation for interacting with the TonicPow API +# go-tonicpow +**go-tonicpow** is the official golang implementation for interacting with the TonicPow API -[![Build Status](https://travis-ci.com/tonicpow/tonicpow-go.svg?branch=master)](https://travis-ci.com/tonicpow/tonicpow-go) -[![Report](https://goreportcard.com/badge/github.com/tonicpow/tonicpow-go?style=flat)](https://goreportcard.com/report/github.com/tonicpow/tonicpow-go) -[![Release](https://img.shields.io/github/release-pre/tonicpow/tonicpow-go.svg?style=flat)](https://github.com/tonicpow/tonicpow-go/releases) +[![Build Status](https://travis-ci.com/tonicpow/go-tonicpow.svg?branch=master)](https://travis-ci.com/tonicpow/go-tonicpow) +[![Report](https://goreportcard.com/badge/github.com/tonicpow/go-tonicpow?style=flat)](https://goreportcard.com/report/github.com/tonicpow/go-tonicpow) +[![Release](https://img.shields.io/github/release-pre/tonicpow/go-tonicpow.svg?style=flat)](https://github.com/tonicpow/go-tonicpow/releases) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat)](https://github.com/RichardLitt/standard-readme) -[![GoDoc](https://godoc.org/github.com/tonicpow/tonicpow-go?status.svg&style=flat)](https://godoc.org/github.com/tonicpow/tonicpow-go) +[![GoDoc](https://godoc.org/github.com/tonicpow/go-tonicpow?status.svg&style=flat)](https://godoc.org/github.com/tonicpow/go-tonicpow) ## Table of Contents - [Installation](#installation) @@ -20,13 +20,13 @@ ## Installation -**tonicpow-go** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy). +**go-tonicpow** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy). ```bash -$ go get -u github.com/tonicpow/tonicpow-go +$ go get -u github.com/tonicpow/go-tonicpow ``` ## Documentation -You can view the generated [documentation here](https://godoc.org/github.com/tonicpow/tonicpow-go). +You can view the generated [documentation here](https://godoc.org/github.com/tonicpow/go-tonicpow). ### Features - Complete coverage for the [TonicPow.com](https://tonicpow.com/) API @@ -35,24 +35,24 @@ You can view the generated [documentation here](https://godoc.org/github.com/ton - Using [heimdall http client](https://github.com/gojek/heimdall) with exponential backoff & more ## Examples & Tests -All unit tests and [examples](tonicpow_test.go) run via [Travis CI](https://travis-ci.org/tonicpow/tonicpow-go) and uses [Go version 1.13.x](https://golang.org/doc/go1.13). View the [deployment configuration file](.travis.yml). +All unit tests and [examples](tonicpow_test.go) run via [Travis CI](https://travis-ci.org/tonicpow/go-tonicpow) and uses [Go version 1.13.x](https://golang.org/doc/go1.13). View the [deployment configuration file](.travis.yml). Run all tests (including integration tests) ```bash -$ cd ../tonicpow-go +$ cd ../go-tonicpow $ go test ./... -v ``` Run tests (excluding integration tests) ```bash -$ cd ../tonicpow-go +$ cd ../go-tonicpow $ go test ./... -v -test.short ``` ## Benchmarks Run the Go [benchmarks](tonicpow_test.go): ```bash -$ cd ../tonicpow-go +$ cd ../go-tonicpow $ go test -bench . -benchmem ``` @@ -67,7 +67,7 @@ Basic implementation: package main import ( - "github.com/tonicpow/tonicpow-go" + "github.com/tonicpow/go-tonicpow" ) func main() { @@ -78,7 +78,7 @@ func main() { ## Maintainers -[@MrZ1836](https://github.com/mrz1836) +[@MrZ](https://github.com/mrz1836) ## Contributing @@ -88,8 +88,8 @@ View the [contributing guidelines](CONTRIBUTING.md) and follow the [code of cond Support the development of this project 🙏 -[![Donate](https://img.shields.io/badge/donate-bitcoin-brightgreen.svg)](https://mrz1818.com/?tab=tips&af=tonicpow-go) +[![Donate](https://img.shields.io/badge/donate-bitcoin-brightgreen.svg)](https://mrz1818.com/?tab=tips&af=go-tonicpow) ## License -![License](https://img.shields.io/github/license/tonicpow/tonicpow-go.svg?style=flat) +![License](https://img.shields.io/github/license/tonicpow/go-tonicpow.svg?style=flat) diff --git a/go.mod b/go.mod index 09380af..de90b36 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mrz1836/tonicpow-go +module github.com/tonicpow/go-tonicpow go 1.13 @@ -7,4 +7,5 @@ require ( github.com/gojektech/heimdall v5.0.2+incompatible // indirect github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 // indirect github.com/pkg/errors v0.8.1 // indirect + github.com/stretchr/testify v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 914d59d..6f9631a 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gojek/heimdall v5.0.2+incompatible h1:S9IJNuRErtH5MZ7Aps10haoTAoxy9Q0E0bYIjJZT7Vg= github.com/gojek/heimdall v5.0.2+incompatible/go.mod h1:caFYHVXyKSrgUJgtgHM+KJZGyI1wWxghxu7aFPLVfI8= github.com/gojektech/heimdall v5.0.2+incompatible h1:mfGLnHNTKN7b1OMTO4ZvL3oT2P13kqTTV7owK7BZDck= @@ -6,3 +8,12 @@ github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45 h1:MO2DsGCZz8ph github.com/gojektech/valkyrie v0.0.0-20190210220504-8f62c1e7ba45/go.mod h1:tDYRk1s5Pms6XJjj5m2PxAzmQvaDU8GqDf1u6x7yxKw= 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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/tonicpow.go b/tonicpow.go index 496dd71..ac0042d 100644 --- a/tonicpow.go +++ b/tonicpow.go @@ -44,7 +44,7 @@ type RequestParameters struct { UserAgent string } -// LastRequest is used to track what was submitted to whatsonchain on the Request() +// LastRequest is used to track what was submitted via the Request() type LastRequest struct { // Method is either POST or GET @@ -63,7 +63,7 @@ type LastRequest struct { // NewClient creates a new client to submit queries with. // Parameters values are set to the defaults defined by TonicPow. // -// For more information: https://tonicpow.com +// For more information: https://docs.tonicpow.com func NewClient(advertiserSecretKey string) (c *Client, err error) { // Create a client @@ -213,8 +213,7 @@ func (c *Client) ConvertGoal(goalName string, sessionTxID string, userID string, // Fire the request var resp string - resp, err = c.Request("conversions", "POST", &postData) - if err != nil { + if resp, err = c.Request("conversions", "POST", &postData); err != nil { return }