Skip to content

Commit 97977d5

Browse files
committed
Use ergochat/readline and remove vendors directory
1 parent f85e849 commit 97977d5

File tree

512 files changed

+27
-250019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

512 files changed

+27
-250019
lines changed

Makefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null
2222
cat $(CURDIR)/.version 2> /dev/null || echo v0)
2323
BIN = $(CURDIR)/bin
2424
BASE = $(CURDIR)
25-
PKGS = $(or $(PKG),$(shell $(GO) list ./... | grep -v "^$(PACKAGE)/vendor/"))
25+
PKGS = $(or $(PKG),$(shell $(GO) list ./...))
2626
TESTPKGS = $(shell $(GO) list -f '{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' $(PKGS))
2727
GIT_SHA = $(shell git rev-parse --short HEAD)
2828

@@ -36,7 +36,7 @@ M = $(shell printf "\033[34;1m▶\033[0m ")
3636

3737
.PHONY: all
3838
all: fmt ; $(info $(M) Building executable… $(GIT_SHA)) @ ## Build program binary
39-
$Q $(GO) build -mod=vendor \
39+
$Q $(GO) build \
4040
-tags release \
4141
-ldflags '-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' \
4242
-o bin/$(PACKAGE) cmk.go
@@ -46,24 +46,24 @@ run: all
4646
./bin/cmk
4747

4848
debug:
49-
$(GO) build -mod=vendor -gcflags='-N -l' -o cmk && dlv --listen=:2345 --headless=true --api-version=2 exec ./cmk
49+
$(GO) build -gcflags='-N -l' -o cmk && dlv --listen=:2345 --headless=true --api-version=2 exec ./cmk
5050

5151
dist-mkdir: all
5252
rm -fr dist
5353
mkdir -p dist
5454

5555
dist-linux: dist-mkdir
56-
GOOS=linux GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86-64 cmk.go
57-
GOOS=linux GOARCH=386 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86 cmk.go
58-
GOOS=linux GOARCH=arm $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm32 cmk.go
59-
GOOS=linux GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm64 cmk.go
56+
GOOS=linux GOARCH=amd64 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86-64 cmk.go
57+
GOOS=linux GOARCH=386 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.x86 cmk.go
58+
GOOS=linux GOARCH=arm $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm32 cmk.go
59+
GOOS=linux GOARCH=arm64 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm64 cmk.go
6060

6161

6262
dist: dist-linux
63-
GOOS=windows GOARCH=386 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86.exe cmk.go
64-
GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86-64.exe cmk.go
65-
GOOS=darwin GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.x86-64 cmk.go
66-
GOOS=darwin GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.arm64 cmk.go
63+
GOOS=windows GOARCH=386 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86.exe cmk.go
64+
GOOS=windows GOARCH=amd64 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.windows.x86-64.exe cmk.go
65+
GOOS=darwin GOARCH=amd64 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.x86-64 cmk.go
66+
GOOS=darwin GOARCH=arm64 $(GO) build -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.arm64 cmk.go
6767

6868
# Tools
6969

@@ -100,10 +100,10 @@ test-verbose: ARGS=-v ## Run tests in verbose mode with coverage repo
100100
test-race: ARGS=-race ## Run tests with race detector
101101
$(TEST_TARGETS): NAME=$(MAKECMDGOALS:test-%=%)
102102
$(TEST_TARGETS): test
103-
check test tests: fmt lint vendor | $(BASE) ; $(info $(M) Running $(NAME:%=% )tests…) @ ## Run tests
103+
check test tests: fmt lint | $(BASE) ; $(info $(M) Running $(NAME:%=% )tests…) @ ## Run tests
104104
$Q cd $(BASE) && $(GO) test -timeout $(TIMEOUT)s $(ARGS) $(TESTPKGS)
105105

106-
test-xml: fmt lint vendor | $(BASE) $(GO2XUNIT) ; $(info $(M) Running $(NAME:%=% )tests…) @ ## Run tests with xUnit output
106+
test-xml: fmt lint | $(BASE) $(GO2XUNIT) ; $(info $(M) Running $(NAME:%=% )tests…) @ ## Run tests with xUnit output
107107
$Q cd $(BASE) && 2>&1 $(GO) test -timeout 20s -v $(TESTPKGS) | tee test/tests.output
108108
$(GO2XUNIT) -fail -input test/tests.output -output test/tests.xml
109109

@@ -114,12 +114,12 @@ COVERAGE_HTML = $(COVERAGE_DIR)/index.html
114114
.PHONY: test-coverage test-coverage-tools
115115
test-coverage-tools: | $(GOCOVMERGE) $(GOCOV) $(GOCOVXML)
116116
test-coverage: COVERAGE_DIR := $(CURDIR)/test/coverage.$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
117-
test-coverage: fmt lint vendor test-coverage-tools | $(BASE) ; $(info $(M) Running coverage tests…) @ ## Run coverage tests
117+
test-coverage: fmt lint test-coverage-tools | $(BASE) ; $(info $(M) Running coverage tests…) @ ## Run coverage tests
118118
$Q mkdir -p $(COVERAGE_DIR)/coverage
119119
$Q cd $(BASE) && for pkg in $(TESTPKGS); do \
120120
$(GO) test \
121121
-coverpkg=$$($(GO) list -f '{{ join .Deps "\n" }}' $$pkg | \
122-
grep '^$(PACKAGE)/' | grep -v '^$(PACKAGE)/vendor/' | \
122+
grep '^$(PACKAGE)/' | \
123123
tr '\n' ',')$$pkg \
124124
-covermode=$(COVERAGE_MODE) \
125125
-coverprofile="$(COVERAGE_DIR)/coverage/`echo $$pkg | tr "/" "-"`.cover" $$pkg ;\
@@ -129,14 +129,14 @@ test-coverage: fmt lint vendor test-coverage-tools | $(BASE) ; $(info $(M) Runni
129129
$Q $(GOCOV) convert $(COVERAGE_PROFILE) | $(GOCOVXML) > $(COVERAGE_XML)
130130

131131
.PHONY: lint
132-
lint: vendor | $(BASE) $(GOLINT) ; $(info $(M) Running golint…) @ ## Run golint
132+
lint: $(BASE) $(GOLINT) ; $(info $(M) Running golint…) @ ## Run golint
133133
$Q cd $(BASE) && ret=0 && for pkg in $(PKGS); do \
134134
test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \
135135
done ; exit $$ret
136136

137137
.PHONY: fmt
138138
fmt: ; $(info $(M) Running gofmt…) @ ## Run gofmt on all source files
139-
@ret=0 && for d in $$($(GO) list -mod=vendor -f '{{.Dir}}' ./... | grep -v /vendor/); do \
139+
@ret=0 && for d in $$($(GO) list -f '{{.Dir}}' ./...); do \
140140
$(GOFMT) -l -w $$d/*.go || ret=$$? ; \
141141
done ; exit $$ret
142142

cli/prompt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strings"
2424

2525
"github.com/apache/cloudstack-cloudmonkey/config"
26-
"github.com/chzyer/readline"
26+
"github.com/ergochat/readline"
2727
)
2828

2929
// CLI config instance

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ go 1.20
2121

2222
require (
2323
github.com/briandowns/spinner v1.22.0
24-
github.com/chzyer/readline v1.5.1
24+
github.com/ergochat/readline v0.1.3
2525
github.com/gofrs/flock v0.8.1
2626
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
2727
github.com/mitchellh/go-homedir v1.1.0
@@ -37,7 +37,8 @@ require (
3737
github.com/mattn/go-runewidth v0.0.14 // indirect
3838
github.com/rivo/uniseg v0.4.4 // indirect
3939
github.com/stretchr/testify v1.8.2 // indirect
40-
golang.org/x/sys v0.5.0 // indirect
40+
golang.org/x/sys v0.15.0 // indirect
4141
golang.org/x/term v0.5.0 // indirect
42+
golang.org/x/text v0.9.0 // indirect
4243
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
4344
)

go.sum

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
github.com/briandowns/spinner v1.22.0 h1:fJ/7tyeM2q9ebM57kGfjnUSrgPJBsULk+/s61UpMGrw=
22
github.com/briandowns/spinner v1.22.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE=
3-
github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=
4-
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
5-
github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI=
6-
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
7-
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
8-
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
93
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
104
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
115
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/ergochat/readline v0.1.3 h1:/DytGTmwdUJcLAe3k3VJgowh5vNnsdifYT6uVaf4pSo=
7+
github.com/ergochat/readline v0.1.3/go.mod h1:o3ux9QLHLm77bq7hDB21UTm6HlV2++IPDMfIfKDuOgY=
128
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
139
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
1410
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
@@ -44,12 +40,13 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
4440
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
4541
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
4642
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
47-
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4843
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
49-
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
50-
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
44+
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
45+
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
5146
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
5247
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
48+
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
49+
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
5350
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
5451
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
5552
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

snap/snapcraft.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ parts:
5353
cd "$CRAFT_PART_SRC"
5454
SHORT_SHA="$(cat .remote-sha 2>/dev/null || echo unknown)"
5555
BUILD_DATE="$(date +%FT%T%z)"
56-
go mod vendor || true
5756
go build -trimpath \
5857
-ldflags "-s -w -X main.GitSHA=${SHORT_SHA} -X main.BuildDate=${BUILD_DATE}" \
5958
-o cmk cmk.go

vendor/github.com/briandowns/spinner/.gitignore

Lines changed: 0 additions & 29 deletions
This file was deleted.

vendor/github.com/briandowns/spinner/.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)