From a0efc3cdede3622a27dd8e834da5daabe5f2224b Mon Sep 17 00:00:00 2001 From: jbeemster Date: Tue, 21 Aug 2018 12:11:09 +0200 Subject: [PATCH] Prepared for release --- CHANGELOG | 4 ++++ README.md | 8 ++++---- VERSION | 2 +- snowplowtrk.go | 15 +++++++-------- snowplowtrk_test.go | 6 +++--- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 16f880c..3a6bbb5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 0.3.0 (2018-09-05) +-------------------------- +Add ability to set custom IP Address (#18) + Version 0.2.0 (2018-08-21) -------------------------- Fix README formatting (#8) diff --git a/README.md b/README.md index 066b433..4a5cf1b 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ limitations under the License. [travis-image]: https://travis-ci.org/snowplow/snowplow-tracking-cli.png?branch=master [travis]: https://travis-ci.org/snowplow/snowplow-tracking-cli -[release-image]: http://img.shields.io/badge/release-0.2.0-6ad7e5.svg?style=flat +[release-image]: http://img.shields.io/badge/release-0.3.0-6ad7e5.svg?style=flat [releases]: https://github.com/snowplow/snowplow-tracking-cli/releases [license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat @@ -111,6 +111,6 @@ limitations under the License. [golang-tracker]: https://github.com/snowplow/snowplow-golang-tracker [sd-json]: http://snowplowanalytics.com/blog/2014/05/15/introducing-self-describing-jsons/ -[linux-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.2.0_linux_amd64.zip -[windows-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.2.0_windows_amd64.zip -[darwin-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.2.0_darwin_amd64.zip +[linux-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.3.0_linux_amd64.zip +[windows-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.3.0_windows_amd64.zip +[darwin-binary]: https://bintray.com/snowplow/snowplow-generic/download_file?file_path=snowplow_tracking_cli_0.3.0_darwin_amd64.zip diff --git a/VERSION b/VERSION index 341cf11..9325c3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 \ No newline at end of file +0.3.0 \ No newline at end of file diff --git a/snowplowtrk.go b/snowplowtrk.go index 2ecf3bf..a41ebd9 100644 --- a/snowplowtrk.go +++ b/snowplowtrk.go @@ -24,7 +24,7 @@ import ( ) const ( - appVersion = "0.2.0" + appVersion = "0.3.0" appName = "snowplowtrk" appUsage = "Snowplow Analytics Tracking CLI" appCopyright = "(c) 2016-2018 Snowplow Analytics, LTD" @@ -106,7 +106,7 @@ func main() { // Check that collector domain exists if collector == "" { - return cli.NewExitError("FATAL: A --collector needs to be specified.", 1) + return cli.NewExitError("fatal: --collector needs to be specified", 1) } // Fetch the SelfDescribing JSON @@ -125,7 +125,7 @@ func main() { // Parse return code returnCode := parseStatusCode(statusCode) if returnCode != 0 { - return cli.NewExitError("ERROR: Event failed to send, check your collector endpoint and try again...", returnCode) + return cli.NewExitError("error: event failed to send, check your collector endpoint and try again", returnCode) } return nil } @@ -139,7 +139,7 @@ func main() { // and attempts to return a SelfDescribingJson. func getSdJSON(sdjson string, schema string, jsonData string) (*gt.SelfDescribingJson, error) { if sdjson == "" && schema == "" && jsonData == "" { - return nil, errors.New("FATAL: A --sdjson or a --schema URI plus a --json needs to be specified.") + return nil, errors.New("fatal: --sdjson or --schema URI plus a --json needs to be specified") } else if sdjson != "" { // Process SelfDescribingJson String res := selfDescJSON{} @@ -151,9 +151,9 @@ func getSdJSON(sdjson string, schema string, jsonData string) (*gt.SelfDescribin } return gt.InitSelfDescribingJson(res.Schema, res.Data), nil } else if schema != "" && jsonData == "" { - return nil, errors.New("FATAL: A --json needs to be specified.") + return nil, errors.New("fatal: --json needs to be specified") } else if schema == "" && jsonData != "" { - return nil, errors.New("FATAL: A --schema URI needs to be specified.") + return nil, errors.New("fatal: --schema URI needs to be specified") } else { // Process Schema and Json Strings jsonDataMap, err := stringToMap(jsonData) @@ -247,7 +247,6 @@ func stringToMap(str string) (map[string]interface{}, error) { err := d.Decode(&jsonDataMap) if err != nil { return nil, err - } else { - return jsonDataMap, nil } + return jsonDataMap, nil } diff --git a/snowplowtrk_test.go b/snowplowtrk_test.go index 1112da5..2355649 100644 --- a/snowplowtrk_test.go +++ b/snowplowtrk_test.go @@ -30,17 +30,17 @@ func TestGetSdJSON(t *testing.T) { sdj, err := getSdJSON("", "", "") assert.Nil(sdj) assert.NotNil(err) - assert.Equal("FATAL: A --sdjson or a --schema URI plus a --json needs to be specified.", err.Error()) + assert.Equal("fatal: --sdjson or --schema URI plus a --json needs to be specified", err.Error()) sdj, err = getSdJSON("", "iglu:com.acme/event/jsonschema/1-0-0", "") assert.Nil(sdj) assert.NotNil(err) - assert.Equal("FATAL: A --json needs to be specified.", err.Error()) + assert.Equal("fatal: --json needs to be specified", err.Error()) sdj, err = getSdJSON("", "", "{\"e\":\"pv\"}") assert.Nil(sdj) assert.NotNil(err) - assert.Equal("FATAL: A --schema URI needs to be specified.", err.Error()) + assert.Equal("fatal: --schema URI needs to be specified", err.Error()) sdj, err = getSdJSON("", "iglu:com.acme/event/jsonschema/1-0-0", "{\"e\":\"pv\"}") assert.Nil(err)