diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 712196a..89ed8b5 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 @@ -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 .) 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 {