mirror of
https://github.com/manifoldco/promptui.git
synced 2026-03-14 22:35:53 +01:00
Use go modules when building on go 1.11.x
Remove go.1.8 as well, as it's no longer supported.
This commit is contained in:
parent
ad16ba47f5
commit
e9daf51ccc
5 changed files with 110 additions and 63 deletions
|
|
@ -1,6 +1,5 @@
|
|||
language: go
|
||||
go:
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
|
|
|
|||
51
Makefile
51
Makefile
|
|
@ -1,55 +1,64 @@
|
|||
LINTERS=\
|
||||
HAS_GO_MOD=$(shell go help mod; echo $$?)
|
||||
LINTERS=$(shell grep "// lint" tools.go | awk '{gsub(/\"/, "", $$1); print $$1}' | awk -F / '{print $$NF}') \
|
||||
gofmt \
|
||||
golint \
|
||||
gosimple \
|
||||
vet \
|
||||
misspell \
|
||||
ineffassign \
|
||||
deadcode
|
||||
vet
|
||||
|
||||
ci: $(LINTERS) test
|
||||
|
||||
.PHONY: ci
|
||||
|
||||
#################################################
|
||||
# Bootstrapping for base golang package deps
|
||||
# Bootstrapping for base golang package and tool deps
|
||||
#################################################
|
||||
|
||||
CMD_PKGS=\
|
||||
github.com/golang/lint/golint \
|
||||
honnef.co/go/tools/cmd/gosimple \
|
||||
github.com/client9/misspell/cmd/misspell \
|
||||
github.com/gordonklaus/ineffassign \
|
||||
github.com/tsenart/deadcode \
|
||||
github.com/alecthomas/gometalinter
|
||||
CMD_PKGS=$(shell grep ' "' tools.go | awk -F '"' '{print $$2}')
|
||||
|
||||
define VENDOR_BIN_TMPL
|
||||
vendor/bin/$(notdir $(1)): vendor
|
||||
go build -o $$@ ./vendor/$(1)
|
||||
vendor/bin/$(notdir $(1)): vendor/$(1) | vendor
|
||||
go build -a -o $$@ ./vendor/$(1)
|
||||
VENDOR_BINS += vendor/bin/$(notdir $(1))
|
||||
vendor/$(1): vendor
|
||||
endef
|
||||
|
||||
$(foreach cmd_pkg,$(CMD_PKGS),$(eval $(call VENDOR_BIN_TMPL,$(cmd_pkg))))
|
||||
|
||||
$(patsubst %,%-bin,$(filter-out gofmt vet,$(LINTERS))): %-bin: vendor/bin/%
|
||||
gofmt-bin vet-bin:
|
||||
|
||||
ifeq ($(HAS_GO_MOD),0)
|
||||
bootstrap:
|
||||
|
||||
vendor: go.sum
|
||||
GO111MODULE=on go mod vendor
|
||||
else
|
||||
bootstrap:
|
||||
which dep || go get -u github.com/golang/dep/cmd/dep
|
||||
|
||||
vendor: Gopkg.lock
|
||||
dep ensure
|
||||
dep ensure -vendor-only
|
||||
endif
|
||||
|
||||
.PHONY: bootstrap $(CMD_PKGS)
|
||||
mod-update:
|
||||
GO111MODULE=on go get -u -m
|
||||
GO111MODULE=on go mod tidy
|
||||
dep ensure -update
|
||||
|
||||
mod-tidy:
|
||||
GO111MODULE=on go mod tidy
|
||||
|
||||
.PHONY: $(CMD_PKGS)
|
||||
.PHONY: mod-update mod-tidy
|
||||
|
||||
#################################################
|
||||
# Test and linting
|
||||
#################################################
|
||||
|
||||
test: vendor
|
||||
@CGO_ENABLED=0 go test -v $$(go list ./... | grep -v vendor)
|
||||
CGO_ENABLED=0 go test $$(go list ./... | grep -v generated)
|
||||
|
||||
$(LINTERS): %: vendor/bin/gometalinter %-bin vendor
|
||||
PATH=`pwd`/vendor/bin:$$PATH gometalinter --tests --disable-all --vendor \
|
||||
--deadline=5m -s data ./... --enable $@
|
||||
--deadline=5m -s data --enable $@ ./...
|
||||
|
||||
.PHONY: $(LINTERS) test
|
||||
.PHONY: cover all-cover.txt
|
||||
|
|
|
|||
46
go.mod
46
go.mod
|
|
@ -1,24 +1,32 @@
|
|||
module github.com/manifoldco/promptui
|
||||
|
||||
require (
|
||||
github.com/alecthomas/gometalinter v1.2.1
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
|
||||
github.com/chzyer/readline v0.0.0-20171003145950-6a4bc7b4feae
|
||||
github.com/client9/misspell v0.3.0
|
||||
github.com/golang/lint v0.0.0-20171005223336-6aaf7c34af0f
|
||||
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20170825171107-da3d65debb9b
|
||||
github.com/juju/ansiterm v0.0.0-20161107204639-35c59b9e0fe2
|
||||
github.com/kisielk/gotool v0.0.0-20170828042310-d6ce6262d87e
|
||||
github.com/lunixbochs/vtclean v0.0.0-20170504063817-d14193dfc626
|
||||
github.com/mattn/go-colorable v0.0.9
|
||||
github.com/mattn/go-isatty v0.0.3
|
||||
github.com/nicksnyder/go-i18n v1.9.0
|
||||
github.com/pelletier/go-toml v1.0.1
|
||||
github.com/alecthomas/gometalinter v2.0.11+incompatible
|
||||
github.com/chzyer/logex v1.1.10 // indirect
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
|
||||
github.com/client9/misspell v0.3.4
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3
|
||||
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf // indirect
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc
|
||||
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a // indirect
|
||||
github.com/mattn/go-colorable v0.0.9 // indirect
|
||||
github.com/mattn/go-isatty v0.0.4 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/stretchr/testify v1.2.2 // indirect
|
||||
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9
|
||||
golang.org/x/sys v0.0.0-20171013135506-686000749eae
|
||||
golang.org/x/tools v0.0.0-20171013181403-9bd2f442688b
|
||||
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20171010053543-63abe20a23e2
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7
|
||||
honnef.co/go/tools v0.0.0-20170921140605-e5147431c7c0
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b // indirect
|
||||
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
||||
)
|
||||
|
||||
// This version of kingpin is incompatible with the released version of
|
||||
// gometalinter until the next release of gometalinter, and possibly until it
|
||||
// has go module support, we'll need this exclude, and perhaps some more.
|
||||
//
|
||||
// After that point, we should be able to remove it.
|
||||
exclude gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20180810215634-df19058c872c
|
||||
|
|
|
|||
64
go.sum
64
go.sum
|
|
@ -1,25 +1,45 @@
|
|||
github.com/alecthomas/gometalinter v1.2.1/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/chzyer/readline v0.0.0-20171003145950-6a4bc7b4feae h1:drLWOmMTKbNwn9ao2UpwECoQcHC4blPvsQSGtOJ7EC0=
|
||||
github.com/chzyer/readline v0.0.0-20171003145950-6a4bc7b4feae/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/client9/misspell v0.3.0/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/golang/lint v0.0.0-20171005223336-6aaf7c34af0f/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20170825171107-da3d65debb9b/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
|
||||
github.com/juju/ansiterm v0.0.0-20161107204639-35c59b9e0fe2 h1:zwBJ/tDI/v8fUUaw/BXYLKAfATaLsbAWcMPKskykWfA=
|
||||
github.com/juju/ansiterm v0.0.0-20161107204639-35c59b9e0fe2/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU=
|
||||
github.com/kisielk/gotool v0.0.0-20170828042310-d6ce6262d87e/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM=
|
||||
github.com/lunixbochs/vtclean v0.0.0-20170504063817-d14193dfc626 h1:33Ys8SnkRfz5ojdG853pyT/2Iqbk95PVm+QrC5XvI70=
|
||||
github.com/lunixbochs/vtclean v0.0.0-20170504063817-d14193dfc626/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/alecthomas/gometalinter v2.0.11+incompatible h1:toROE7pXPU/pUB4lh6ICqUKwpDtmkRCyJIr1nYqmKp0=
|
||||
github.com/alecthomas/gometalinter v2.0.11+incompatible/go.mod h1:qfIpQGGz3d+NmgyPBqv+LSh50emm1pt72EtcX2vKYQk=
|
||||
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3 h1:I4BOK3PBMjhWfQM2zPJKK7lOBGsrsvOB7kBELP33hiE=
|
||||
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf h1:7+FW5aGwISbqUtkfmIpZJGRgNFg2ioYPvFaUxdqpDsg=
|
||||
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc h1:cJlkeAx1QYgO5N80aF5xRGstVsRQwgLR7uA2FnP1ZjY=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
|
||||
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU=
|
||||
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw=
|
||||
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/nicksnyder/go-i18n v1.9.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q=
|
||||
github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
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/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 h1:vY5WqiEon0ZSTGM3ayVVi+twaHKHDFUVloaQ/wug9/c=
|
||||
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk=
|
||||
golang.org/x/sys v0.0.0-20171013135506-686000749eae/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/tools v0.0.0-20171013181403-9bd2f442688b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20171010053543-63abe20a23e2/go.mod h1:3HH7i1SgMqlzxCcBmUHW657sD4Kvv9sC3HpL3YukzwA=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
honnef.co/go/tools v0.0.0-20170921140605-e5147431c7c0/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 h1:x/bBzNauLQAlE3fLku/xy92Y8QwKX5HZymrMz2IiKFc=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b h1:MQE+LT/ABUuuvEZ+YQAMSXindAdUh7slEmAkup74op4=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 h1:bsEj/LXbv3BCtkp/rBj9Wi/0Nde4OMaraIZpndHAhdI=
|
||||
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
|||
11
tools.go
Normal file
11
tools.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// +build tools
|
||||
|
||||
package tools
|
||||
|
||||
import (
|
||||
"github.com/alecthomas/gometalinter"
|
||||
"github.com/client9/misspell/cmd/misspell" // lint
|
||||
"github.com/golang/lint/golint" // lint
|
||||
"github.com/gordonklaus/ineffassign" // lint
|
||||
"github.com/tsenart/deadcode" // lint
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue