Skip to content

Commit 848b7a5

Browse files
feat: [email protected] support (#566)
* add [email protected] support * increase unsupported versions to [email protected] * fix vet * upgrade some vendors
1 parent 503d2c2 commit 848b7a5

File tree

121 files changed

+28999
-242
lines changed

Some content is hidden

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

121 files changed

+28999
-242
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ matrix:
1919
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
2020
- go: "1.11"
2121
env: TEST_WITH_REAL_API=1
22+
- go: "1.12"
23+
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
24+
- go: "1.12"
25+
env: TEST_WITH_REAL_API=1
2226
- go: tip
2327
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
2428
allow_failures:

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ GOBUILD ?= $(GO) build
66
GOCLEAN ?= $(GO) clean
77
GOINSTALL ?= $(GO) install
88
GOTEST ?= $(GO) test $(GOTESTFLAGS)
9+
GOMINORVERSION ?= $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
910
GOFMT ?= gofmt -w -s
1011
GODIR ?= github.com/scaleway/scaleway-cli
1112
GOCOVER ?= $(GOTEST) -covermode=count -v
@@ -31,12 +32,12 @@ NAME = scw
3132
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
3233
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
3334

35+
36+
3437
SOURCES := $(call rwildcard,./pkg ./cmd,*.go)
3538
COMMANDS := $(call uniq,$(dir $(call rwildcard,./cmd/,*.go)))
3639
PACKAGES := $(call uniq,$(dir $(call rwildcard,./pkg/,*.go))) .
3740

38-
REL_COMMANDS := $(subst $(GODIR),.,$(COMMANDS))
39-
REL_PACKAGES := $(subst $(GODIR),.,$(PACKAGES))
4041
REV = $(shell git rev-parse --short HEAD 2>/dev/null || echo "nogit")
4142
LDFLAGS = "-X `go list ./pkg/scwversion`.GITCOMMIT=$(REV) -s"
4243
BUILDER = scaleway-cli-builder
@@ -62,7 +63,13 @@ fmt: $(FMT_LIST)
6263

6364

6465
$(BUILD_LIST): %_build: %_fmt
65-
@go tool vet --all=true $(shell echo $(SOURCES) | tr " " "\n" | grep -v test.go)
66+
@# https://golang.org/doc/go1.12#vet
67+
@# vel = go tip version
68+
@if [ $(GOMINORVERSION) = vel ] || [ $(GOMINORVERSION) -gt 11 ]; then \
69+
$(GO) vet ./...; \
70+
else \
71+
$(GO) tool vet --all=true $(shell echo $(SOURCES) | tr " " "\n" | grep -v test.go); \
72+
fi
6673
$(GOBUILD) -ldflags $(LDFLAGS) -o $(NAME) ./cmd/$(NAME)
6774

6875
$(CLEAN_LIST): %_clean:

cmd/scw/main_unsupported.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// +build !go1.5
1+
// +build !go1.10
22

33
package main
44

55
func error() {
6-
`Bad go version, please install a version greater than or equal to 1.5`
6+
`Bad go version, please install a version greater than or equal to 1.10`
77
}

goversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// +build go1.5
1+
// +build go1.10
22

33
package goversion

goversion_unsupported.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// +build !go1.5
1+
// +build !go1.10
22

33
package goversion
44

55
func error() {
6-
`Bad go version, please install a version greater than or equal to 1.5`
6+
`Bad go version, please install a version greater than or equal to 1.10`
77
}

vendor/github.com/containerd/console/LICENSE

Lines changed: 191 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/containerd/console/README.md

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/containerd/console/console.go

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)