From 9ca614aa42f2e0d5848a26d1c2a16b6786dcb0d1 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 19 Oct 2026 21:08:29 +0000 Subject: [PATCH] Build and test with a supported Go release (closes #107) The test and build stages move from golang:1.24-bookworm, a release line that no longer gets security fixes, to golang:1.27.2-bookworm, pinned by digest. The go directive in go.mod moves from 1.24.4 to 1.27.1, the Go in the pinned lint image, so no stage downloads another toolchain. One test starts its goroutine with sync.WaitGroup.Go, which the linter asks for once the module targets Go 1.25 or later. Model: opus-5-5 --- Dockerfile | 8 ++++---- go.mod | 2 +- internal/database/database_internal_test.go | 7 ++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8cfb8c..f2f9d83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # image ships and the alpine one does not. -count=1 because the mounted # cache also holds test results, which go test would otherwise replay. # -short skips the live RIS Live feed test, so the suite needs no network. -# golang:1.24-bookworm, 2026-09-21 -FROM golang@sha256:1a6d4452c65dea36aac2e2d606b01b4a029ec90cc1ae53890540ce6173ea77ac AS test +# golang:1.27.2-bookworm, 2026-10-19 +FROM golang@sha256:5cf287a799e6b94384bad13d16b14904c531f51ba65792237e122ce42b392f61 AS test WORKDIR /src COPY go.mod go.sum ./ RUN go mod download @@ -39,8 +39,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # Build stage. Nothing is wanted from either phase above; the copies # are what make BuildKit build them first, so nothing after them can # run unless lint and test passed. -# golang:1.24-bookworm, 2026-09-21 -FROM golang@sha256:1a6d4452c65dea36aac2e2d606b01b4a029ec90cc1ae53890540ce6173ea77ac AS builder +# golang:1.27.2-bookworm, 2026-10-19 +FROM golang@sha256:5cf287a799e6b94384bad13d16b14904c531f51ba65792237e122ce42b392f61 AS builder # Install build dependencies (zstd for archive, gcc for CGO/sqlite3) RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/go.mod b/go.mod index 4d318d3..10d57f5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.eeqj.de/sneak/routewatch -go 1.24.4 +go 1.27.1 require ( github.com/dustin/go-humanize v1.0.1 diff --git a/internal/database/database_internal_test.go b/internal/database/database_internal_test.go index 92768c9..7a48559 100644 --- a/internal/database/database_internal_test.go +++ b/internal/database/database_internal_test.go @@ -564,11 +564,8 @@ func TestBatchWriteDuringCheckpoint(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup - wg.Add(1) - - go func() { - defer wg.Done() + wg.Go(func() { for { select { case <-ctx.Done(): @@ -577,7 +574,7 @@ func TestBatchWriteDuringCheckpoint(t *testing.T) { _ = db.Checkpoint(ctx) // errors are the checkpoint's own to absorb } } - }() + }) ts := time.Now().UTC() for i := range contentionIterations {