Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Go 1.11.x #56

Merged
merged 2 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
language: go
go:
- 1.10.x
- 1.11.x
- master
services:
- docker
addons:
apt:
update: true
before_install:
- go get github.com/xo/usql
- go get github.com/jessevdk/go-assets-builder
- make depsdev
- docker-compose up -d
- sleep 20s
Expand Down
44 changes: 21 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ else
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
endif

GO ?= GO111MODULE=on go

BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
RELEASE_BUILD_LDFLAGS = -s -w $(BUILD_LDFLAGS)

Expand All @@ -17,14 +19,14 @@ test:
usql my://root:mypass@localhost:33306/testdb -f test/my.sql
usql my://root:mypass@localhost:33308/testdb -f test/my.sql
sqlite3 $(CURDIR)/test/testdb.sqlite3 < test/sqlite.sql
go test -cover -v $(shell go list ./... | grep -v vendor)
$(GO) test -cover -v $(shell $(GO) list ./... | grep -v vendor)
make testdoc

cover: depsdev
goveralls -service=travis-ci
GO111MODULE=on goveralls -service=travis-ci

template:
go generate
$(GO) generate

doc: build
./tbls doc pg://postgres:pgpass@localhost:55432/testdb?sslmode=disable -a test/additional_data.yml -f sample/postgres
Expand Down Expand Up @@ -55,34 +57,30 @@ test_too_many_tables: build
ulimit -n 256 && ./tbls diff pg://postgres:pgpass@localhost:55432/too_many?sslmode=disable /tmp

build: template
go build -ldflags="$(BUILD_LDFLAGS)"

deps:
go get -u github.com/golang/dep/cmd/dep
dep ensure
$(GO) build -ldflags="$(BUILD_LDFLAGS)"

depsdev: deps
go get golang.org/x/tools/cmd/cover
go get golang.org/x/lint/golint
go get github.com/mattn/goveralls
go get github.com/motemen/gobump/cmd/gobump
go get github.com/Songmu/goxz/cmd/goxz
go get github.com/tcnksm/ghr
go get github.com/Songmu/ghch/cmd/ghch
go get github.com/xo/usql
go get github.com/jessevdk/go-assets-builder
depsdev:
$(GO) get golang.org/x/tools/cmd/cover
$(GO) get github.com/mattn/goveralls
$(GO) get github.com/golang/lint/golint
$(GO) get github.com/motemen/gobump/cmd/gobump
$(GO) get github.com/Songmu/goxz/cmd/goxz
$(GO) get github.com/tcnksm/ghr
$(GO) get github.com/Songmu/ghch/cmd/ghch
$(GO) get github.com/xo/usql
$(GO) get github.com/jessevdk/go-assets-builder

crossbuild: deps depsdev
crossbuild: depsdev
$(eval ver = v$(shell gobump show -r version/))
goxz -pv=$(ver) -arch=386,amd64 -build-ldflags="$(RELEASE_BUILD_LDFLAGS)" \
GO111MODULE=on goxz -pv=$(ver) -arch=386,amd64 -build-ldflags="$(RELEASE_BUILD_LDFLAGS)" \
-d=./dist/$(ver)

prerelease:
$(eval ver = v$(shell gobump show -r version/))
ghch -w -N ${ver}
GO111MODULE=on ghch -w -N ${ver}

release: crossbuild
$(eval ver = v$(shell gobump show -r version/))
ghr -username k1LoW -replace ${ver} dist/${ver}
GO111MODULE=on ghr -username k1LoW -replace ${ver} dist/${ver}

.PHONY: default test deps cover
.PHONY: default test cover
40 changes: 40 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module github.com/k1LoW/tbls

require (
github.com/Songmu/ghch v0.3.0 // indirect
github.com/Songmu/goxz v0.1.1 // indirect
github.com/Songmu/retry v0.1.0 // indirect
github.com/go-sql-driver/mysql v1.4.0
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/hashicorp/go-version v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0
github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15
github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect
github.com/lib/pq v0.0.0-20180523175426-90697d60dd84
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mattn/go-runewidth v0.0.2
github.com/mattn/go-sqlite3 v1.9.0
github.com/mholt/archiver v3.0.1+incompatible // indirect
github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286 // indirect
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/pkg/errors v0.8.0
github.com/sergi/go-diff v1.0.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.1
github.com/tcnksm/ghr v0.12.0 // indirect
github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect
github.com/ulikunitz/xz v0.5.5 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xo/dburl v0.0.0-20180616042004-cd61869a0c08
github.com/xo/usql v0.7.0 // indirect
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
golang.org/x/net v0.0.0-20181108082009-03003ca0c849 // indirect
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288 // indirect
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
golang.org/x/tools v0.0.0-20181113033837-a8570e12b662 // indirect
google.golang.org/appengine v1.1.0
gopkg.in/yaml.v2 v2.2.1
)
Loading