Skip to content

Commit

Permalink
feat: go@1.12 support (#566)
Browse files Browse the repository at this point in the history
* add go@1.12 support

* increase unsupported versions to go@1.10

* fix vet

* upgrade some vendors
  • Loading branch information
QuentinBrosse authored Sep 4, 2019
1 parent 503d2c2 commit 848b7a5
Show file tree
Hide file tree
Showing 121 changed files with 28,999 additions and 242 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ matrix:
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
- go: "1.11"
env: TEST_WITH_REAL_API=1
- go: "1.12"
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
- go: "1.12"
env: TEST_WITH_REAL_API=1
- go: tip
env: TEST_WITH_REAL_API=0 GOTESTFLAGS="-race -cpu=1,2,4"
allow_failures:
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GOBUILD ?= $(GO) build
GOCLEAN ?= $(GO) clean
GOINSTALL ?= $(GO) install
GOTEST ?= $(GO) test $(GOTESTFLAGS)
GOMINORVERSION ?= $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
GOFMT ?= gofmt -w -s
GODIR ?= github.com/scaleway/scaleway-cli
GOCOVER ?= $(GOTEST) -covermode=count -v
Expand All @@ -31,12 +32,12 @@ NAME = scw
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))



SOURCES := $(call rwildcard,./pkg ./cmd,*.go)
COMMANDS := $(call uniq,$(dir $(call rwildcard,./cmd/,*.go)))
PACKAGES := $(call uniq,$(dir $(call rwildcard,./pkg/,*.go))) .

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


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

$(CLEAN_LIST): %_clean:
Expand Down
4 changes: 2 additions & 2 deletions cmd/scw/main_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// +build !go1.5
// +build !go1.10

package main

func error() {
`Bad go version, please install a version greater than or equal to 1.5`
`Bad go version, please install a version greater than or equal to 1.10`
}
2 changes: 1 addition & 1 deletion goversion.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// +build go1.5
// +build go1.10

package goversion
4 changes: 2 additions & 2 deletions goversion_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// +build !go1.5
// +build !go1.10

package goversion

func error() {
`Bad go version, please install a version greater than or equal to 1.5`
`Bad go version, please install a version greater than or equal to 1.10`
}
191 changes: 191 additions & 0 deletions vendor/github.com/containerd/console/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions vendor/github.com/containerd/console/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions vendor/github.com/containerd/console/console.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 848b7a5

Please sign in to comment.