diff --git a/.travis.yml b/.travis.yml index 4278353..3869ae0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ language: go go: - - 1.7 - - 1.8 + - 1.x sudo: false -install: - - go get github.com/bmizerany/assert notifications: email: false diff --git a/README.md b/README.md index 3ab856a..24b1167 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ json2csv Converts a stream of newline separated json data to csv format. -[![Build Status](https://travis-ci.org/jehiah/json2csv.png?branch=master)](https://travis-ci.org/jehiah/json2csv) +[![Build Status](https://travis-ci.org/jehiah/json2csv.png?branch=master)](https://travis-ci.org/jehiah/json2csv) [![GitHub release](https://img.shields.io/github/release/jehiah/json2csv.svg)](https://github.com/jehiah/json2csv/releases/latest) Installation diff --git a/dist.sh b/dist.sh index 8f96d21..d24b1cb 100755 --- a/dist.sh +++ b/dist.sh @@ -7,7 +7,7 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "working dir $DIR" echo "... running tests" -go test|| exit 1 +go test ./... || exit 1 arch=$(go env GOARCH) version=$(cat $DIR/version.go | grep "const VERSION" | awk '{print $NF}' | sed 's/"//g') @@ -17,15 +17,17 @@ for os in linux darwin; do echo "... building v$version for $os/$arch" BUILD=$(mktemp -d -t json2csv) TARGET="json2csv-$version.$os-$arch.$goversion" - GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build mkdir -p $BUILD/$TARGET - cp json2csv $BUILD/$TARGET/json2csv + GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/json2csv + pushd $BUILD >/dev/null tar czvf $TARGET.tar.gz $TARGET if [ -e $DIR/dist/$TARGET.tar.gz ]; then echo "... WARNING overwriting dist/$TARGET.tar.gz" fi - mv $TARGET.tar.gz $DIR/dist + + mkdir -p $DIR/dist + mv $TARGET.tar.gz $DIR/dist/ echo "... built dist/$TARGET.tar.gz" popd >/dev/null done \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..335e738 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/jehiah/json2csv + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fdee58 --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +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/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/main.go b/main.go index 21aaf04..eca0ae4 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "log" "math" "os" + "runtime" "strings" "unicode/utf8" ) @@ -29,7 +30,7 @@ func main() { flag.Parse() if *showVersion { - fmt.Printf("json2csv %s\n", VERSION) + fmt.Printf("json2csv v%s (built w/%s)\n", VERSION, runtime.Version()) return } diff --git a/main_test.go b/main_test.go index b023145..f52ac01 100644 --- a/main_test.go +++ b/main_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/bmizerany/assert" + "github.com/stretchr/testify/assert" ) func TestGetTopic(t *testing.T) { diff --git a/version.go b/version.go index 8a86f98..6b4c050 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package main -const VERSION = "1.2.0" +const VERSION = "1.2.1"