You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM--platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain
23
22
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev
24
23
25
24
# build tools
26
25
FROM --platform=${BUILDPLATFORM} toolchain AS tools
27
-
ENV GO111MODULEon
26
+
ENV GO111MODULE=on
28
27
ARG CGO_ENABLED
29
-
ENV CGO_ENABLED${CGO_ENABLED}
28
+
ENV CGO_ENABLED=${CGO_ENABLED}
30
29
ARG GOTOOLCHAIN
31
-
ENV GOTOOLCHAIN${GOTOOLCHAIN}
30
+
ENV GOTOOLCHAIN=${GOTOOLCHAIN}
32
31
ARG GOEXPERIMENT
33
-
ENV GOEXPERIMENT${GOEXPERIMENT}
34
-
ENV GOPATH/go
32
+
ENV GOEXPERIMENT=${GOEXPERIMENT}
33
+
ENV GOPATH=/go
35
34
ARG DEEPCOPY_VERSION
36
35
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \
37
36
&& mv /go/bin/deep-copy /bin/deep-copy
@@ -40,9 +39,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
40
39
&& mv /go/bin/golangci-lint /bin/golangci-lint
41
40
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
42
41
&& mv /go/bin/govulncheck /bin/govulncheck
43
-
ARG GOIMPORTS_VERSION
44
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
45
-
&& mv /go/bin/goimports /bin/goimports
46
42
ARG GOFUMPT_VERSION
47
43
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
48
44
&& mv /go/bin/gofumpt /bin/gofumpt
@@ -64,15 +60,12 @@ RUN --mount=type=cache,target=/go/pkg go list -mod=readonly all >/dev/null
64
60
FROM base AS lint-gofumpt
65
61
RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'gofumpt -w .':\n${FILES}"; exit 1)
66
62
67
-
# runs goimports
68
-
FROM base AS lint-goimports
69
-
RUN FILES="$(goimports -l -local github.com/siderolabs/go-loadbalancer/ .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/go-loadbalancer/ .':\n${FILES}"; exit 1)
70
-
71
63
# runs golangci-lint
72
64
FROM base AS lint-golangci-lint
73
65
WORKDIR /src
74
66
COPY .golangci.yml .
75
-
ENV GOGC 50
67
+
ENV GOGC=50
68
+
RUN golangci-lint config verify --config .golangci.yml
76
69
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml
0 commit comments