From 8fc8e240e0cc4861de3f758749765e4c81ac43b8 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Thu, 15 Jan 2026 08:36:48 +0000 Subject: [PATCH 1/4] ci: add windows tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 712196a..914355e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: go-version: [1.21.x] - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go From 14c22a3d1337a02168d83f0bdb8b1d8bde51a7c7 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Thu, 15 Jan 2026 08:44:37 +0000 Subject: [PATCH 2/4] fix windows tests --- cmp/compare_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmp/compare_test.go b/cmp/compare_test.go index 88b7d45..360d9a7 100644 --- a/cmp/compare_test.go +++ b/cmp/compare_test.go @@ -62,7 +62,8 @@ func mustParseGolden(path string) map[string]string { if err != nil { panic(err) } - s := string(b) + // Normalize CRLF to LF to support Windows. + s := strings.ReplaceAll(string(b), "\r\n", "\n") out := map[string]string{} for len(s) > 0 { From ff4fd734c09ddc396cf83111243158c1fd4d8773 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Thu, 15 Jan 2026 08:51:06 +0000 Subject: [PATCH 3/4] I have applied the fix by adding shell: bash to the workflow step. This will ensure the diff command with process substitution runs correctly on Windows --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 914355e..89ed8b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,4 +20,5 @@ jobs: run: go test -v -race ./... - name: Format if: matrix.go-version == '1.21.x' + shell: bash run: diff -u <(echo -n) <(gofmt -d .) From 79adef07cb443088515dc641331848af6d60dc78 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Thu, 15 Jan 2026 08:57:04 +0000 Subject: [PATCH 4/4] created .gitattributes to enforce LF line endings. This should fix the gofmt failure on Windows. Please push the changes and check the CI again. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf