From 6d16ea098465d7c88e951ff929f45f12b4ac9dae Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 16 Jul 2024 20:17:18 +0200 Subject: [PATCH] user: require go1.21 or higher Signed-off-by: Sebastiaan van Stijn --- Makefile | 18 ++++++++++++------ user/go.mod | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 14e79bd9..7c985286 100644 --- a/Makefile +++ b/Makefile @@ -16,14 +16,18 @@ clean: test: test-local set -eu; \ for p in $(PACKAGES); do \ - (cd $$p; go test $(RUN_VIA_SUDO) -v .); \ + if $p = user && go version | grep -qv go1.17; then \ + (cd $$p; go test $(RUN_VIA_SUDO) -v .); \ + fi \ done .PHONY: tidy tidy: set -eu; \ - for p in $(PACKAGES); do \ - (cd $$p; go mod tidy); \ + for p in $(PACKAGES); do \ + if $p = user && go version | grep -qv go1.17; then \ + (cd $$p; go mod tidy); \ + fi \ done # Test the mount module against the local mountinfo source code instead of the @@ -42,9 +46,11 @@ lint: $(BINDIR)/golangci-lint $(BINDIR)/golangci-lint version set -eu; \ for p in $(PACKAGES); do \ - (cd $$p; \ - go mod download; \ - ../$(BINDIR)/golangci-lint run); \ + if $p = user && go version | grep -qv go1.17; then \ + (cd $$p; \ + go mod download; \ + ../$(BINDIR)/golangci-lint run); \ + fi \ done $(BINDIR)/golangci-lint: $(BINDIR) diff --git a/user/go.mod b/user/go.mod index 1c62fac9..d4ad72f8 100644 --- a/user/go.mod +++ b/user/go.mod @@ -1,5 +1,5 @@ module github.com/moby/sys/user -go 1.17 +go 1.21 require golang.org/x/sys v0.1.0