Skip to content
Snippets Groups Projects
Commit f9f13f0f authored by Arran Walker's avatar Arran Walker
Browse files

Upgrade Go to 1.21.1

parent c7ca3d14
Branches
Tags
No related merge requests found
......@@ -72,9 +72,6 @@ to clean-up build results.
## Tests and validation
We use the usual `go` tools for this, to run those commands you need at least the linter which you can
install with `go get -u golang.org/x/lint/golint`
To run basic validation (fmt, test-short, lint, vet), and the project unit tests, call:
$ make test
......
FROM golang:1.12.9
FROM golang:1.21.1
RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-client \
rsync \
fuse \
fuse3 \
sshfs \
&& rm -rf /var/lib/apt/lists/*
ENV GO111MODULE=on
RUN go get golang.org/x/tools@v0.1.12
RUN go get golang.org/x/lint/golint
RUN go get golang.org/x/tools/cover
ENV GO111MODULE=off
ENV USER root
WORKDIR /go/src/github.com/docker/machine
......
......@@ -10,7 +10,7 @@ environment:
clone_folder: c:\gopath\src\github.com\docker\machine
build_script:
- go build -i -o ./bin/docker-machine.exe ./cmd/docker-machine
- go build -o ./bin/docker-machine.exe ./cmd/docker-machine
test_script:
- powershell -Command go test -v ./libmachine/shell
......
//go:build !windows
// +build !windows
package commands
......
//go:build 386 || amd64
// +build 386 amd64
package virtualbox
......
//go:build !386 && !amd64
// +build !386,!amd64
package virtualbox
......
//go:build !darwin
// +build !darwin
package vmwarefusion
......
......@@ -93,9 +93,11 @@ func (e ErrPluginBinaryNotFound) Error() string {
}
// driverPath finds the path of a driver binary by its name.
// + If the driver is a core driver, there is no separate driver binary. We reuse current binary if it's `docker-machine`
// - If the driver is a core driver, there is no separate driver binary. We reuse current binary if it's `docker-machine`
//
// or we assume `docker-machine` is in the PATH.
// + If the driver is NOT a core driver, then the separate binary must be in the PATH and it's name must be
// - If the driver is NOT a core driver, then the separate binary must be in the PATH and it's name must be
//
// `docker-machine-driver-driverName`
func driverPath(driverName string) string {
for _, coreDriver := range CoreDrivers {
......
//go:build !windows
// +build !windows
package shell
......
//go:build !windows
// +build !windows
package shell
......
......@@ -3,11 +3,7 @@ GO_LDFLAGS := -X `go list ./version`.GitCommit=`git rev-parse --short HEAD 2>/de
GO_GCFLAGS :=
# Full package list
PKGS := $(shell go list -tags "$(BUILDTAGS)" ./... | grep -v "/vendor/" | grep -v "/cmd")
# Resolving binary dependencies for specific targets
GOLINT_BIN := $(GOPATH)/bin/golint
GOLINT := $(shell [ -x $(GOLINT_BIN) ] && echo $(GOLINT_BIN) || echo '')
PKGS := $(shell go list -tags "$(BUILDTAGS)" ./... | grep -v "/cmd")
# Honor debug
ifeq ($(DEBUG),true)
......
fmt:
@test -z "$$(gofmt -s -l . 2>&1 | grep -v vendor/ | tee /dev/stderr)"
@go mod download
@test -z "$$(gofmt -s -l . 2>&1 | tee /dev/stderr)"
vet:
@go mod download
@test -z "$$(go vet $(PKGS) 2>&1 | tee /dev/stderr)"
lint:
$(if $(GOLINT), , \
$(error Please install golint: go get -u golang.org/x/lint/golint))
@test -z "$$($(GOLINT) ./... 2>&1 | grep -v vendor/ | grep -v "cli/" | grep -v "amazonec2/" |grep -v "openstack/" |grep -v "softlayer/" | grep -v "should have comment" | tee /dev/stderr)"
@go mod download
@go install golang.org/x/lint/golint@latest
@test -z "$$(golint ./... 2>&1 | grep -v "cli/" | grep -v "amazonec2/" |grep -v "openstack/" |grep -v "softlayer/" | grep -v "should have comment" | tee /dev/stderr)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment