From 0a8f4fb28584391056168f3664d8c6e42f40447d Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 23 Feb 2019 03:17:33 +0900 Subject: [PATCH] Migrate to go modules --- .travis.yml | 11 ++++++----- Gopkg.lock | 45 --------------------------------------------- Gopkg.toml | 38 -------------------------------------- Makefile | 4 +--- _example/build.sh | 1 + go.mod | 10 ++++++++++ go.sum | 8 ++++++++ 7 files changed, 26 insertions(+), 91 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index e508465..d2ec952 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,12 @@ os: - osx - windows +env: + - GO111MODULE=on + install: - - go get -u golang.org/x/lint/golint - - go get -u golang.org/x/tools/cmd/goimports - - go get -u github.com/golang/dep/cmd/dep - - dep ensure + - GO111MODULE=off go get -u golang.org/x/lint/golint + - GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports stages: - lint @@ -25,7 +26,7 @@ jobs: include: - stage: lint script: - - diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "") + - diff <(goimports -d $(find . -type f -name '*.go')) <(echo -n "") - make lint go: "1.11.x" os: osx diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 1b6866b..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,45 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/mattn/go-colorable" - packages = ["."] - revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" - version = "v0.0.9" - -[[projects]] - name = "github.com/mattn/go-isatty" - packages = ["."] - revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" - version = "v0.0.3" - -[[projects]] - branch = "master" - name = "github.com/mattn/go-runewidth" - packages = ["."] - revision = "ce7b0b5c7b45a81508558cd1dba6bb1e4ddb51bb" - -[[projects]] - branch = "master" - name = "github.com/mattn/go-tty" - packages = ["."] - revision = "931426f7535ac39720c8909d70ece5a41a2502a6" - -[[projects]] - branch = "master" - name = "github.com/pkg/term" - packages = ["termios"] - revision = "cda20d4ac917ad418d86e151eff439648b06185b" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix"] - revision = "ad87a3a340fa7f3bed189293fbfa7a9b7e021ae1" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "d6a0ea9e49092cfd8cb3d6077c97a938de7c39195b83828dae2a0befdd207ffd" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 903f53b..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,38 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/mattn/go-colorable" - version = "0.0.9" - -[[constraint]] - branch = "master" - name = "github.com/mattn/go-tty" - -[[constraint]] - branch = "master" - name = "github.com/pkg/term" - -[[constraint]] - branch = "master" - name = "github.com/mattn/go-runewidth" diff --git a/Makefile b/Makefile index d78ea40..952b463 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,13 @@ .DEFAULT_GOAL := help PKGS := $(shell go list ./...) -SOURCES := $(shell find . -path ./vendor -prune -o -name "*.go" -not -name '*_test.go' -print) +SOURCES := $(shell find . -prune -o -name "*.go" -not -name '*_test.go' -print) .PHONY: setup setup: ## Setup for required tools. go get -u golang.org/x/lint/golint go get -u golang.org/x/tools/cmd/goimports go get -u golang.org/x/tools/cmd/stringer - go get -u github.com/golang/dep/cmd/dep - dep ensure .PHONY: fmt fmt: $(SOURCES) ## Formatting source codes. diff --git a/_example/build.sh b/_example/build.sh index 66f7e18..4c552af 100755 --- a/_example/build.sh +++ b/_example/build.sh @@ -1,5 +1,6 @@ #!/bin/sh +export GO111MODULE=on DIR=$(cd $(dirname $0); pwd) BIN_DIR=$(cd $(dirname $(dirname $0)); pwd)/bin diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bb428ce --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/c-bata/go-prompt + +require ( + github.com/mattn/go-colorable v0.0.9 + github.com/mattn/go-isatty v0.0.3 + github.com/mattn/go-runewidth v0.0.3 + github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a + github.com/pkg/term v0.0.0-20180423043932-cda20d4ac917 + golang.org/x/sys v0.0.0-20180620133508-ad87a3a340fa +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..06cc90f --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= +github.com/pkg/term v0.0.0-20180423043932-cda20d4ac917 h1:BinR73QvQveJdQ8uYZK/8MOjLADpZbI2qs/2+5rnhzQ= +github.com/pkg/term v0.0.0-20180423043932-cda20d4ac917/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +golang.org/x/sys v0.0.0-20180620133508-ad87a3a340fa/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=