From 4ac50067c96e4be00e31181e3ff41f7400afebe6 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 24 Nov 2023 14:04:07 +0100 Subject: [PATCH] internal/build: fix build on latest windows --- .github/workflows/build-test.yml | 20 ++++++++++++++++---- internal/build/gotool.go | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 80427ab2246d3..be11566f96055 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -34,13 +34,25 @@ jobs: needs: lint steps: - - uses: actions/checkout@v2 + steps: + + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.20.5 - - name: Install Submodules - run: git submodule update --init --depth 1 --recursive + - name: Cache testdata + id: cache-testdata + uses: actions/cache@v3 + with: + path: | + tests/testdata + key: ${{ runner.os }}-testdata + + - name: Update git submodules + if: steps.cache-testdata.outputs.cache-hit != 'true' + run: + git submodule update --init --depth 1 --recursive - name: Test run: go run build/ci.go test -dlgo diff --git a/internal/build/gotool.go b/internal/build/gotool.go index a9e0bdf81e452..b7cfcb08f2f93 100644 --- a/internal/build/gotool.go +++ b/internal/build/gotool.go @@ -144,7 +144,7 @@ func Version(csdb *ChecksumDB, version string) (string, error) { continue } if parts[0] == version { - parts[0] = strings.Trim(parts[0], "\r") + parts[0] = strings.Trim(strings.Trim(parts[0], "\r"), "\\r") log.Printf("Found version %q", parts[1]) return parts[1], nil }