Skip to content

Commit

Permalink
Prepared for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeemster committed Sep 5, 2018
1 parent b555b59 commit a0efc3c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.3.0
15 changes: 7 additions & 8 deletions snowplowtrk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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{}
Expand All @@ -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)
Expand Down Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions snowplowtrk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0efc3c

Please sign in to comment.