Skip to content

Commit

Permalink
Merge pull request #39 from jehiah/go_mod_39
Browse files Browse the repository at this point in the history
Go module support
  • Loading branch information
jehiah authored Dec 30, 2019
2 parents d40f54a + 75d51de commit de1f859
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/jehiah/json2csv

go 1.13

require github.com/stretchr/testify v1.4.0
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"log"
"math"
"os"
"runtime"
"strings"
"unicode/utf8"
)
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"testing"

"github.com/bmizerany/assert"
"github.com/stretchr/testify/assert"
)

func TestGetTopic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const VERSION = "1.2.0"
const VERSION = "1.2.1"

0 comments on commit de1f859

Please sign in to comment.