Skip to content

Commit

Permalink
replace \r\n on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Dec 31, 2023
1 parent 4424c45 commit 72f8023
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/utils/goldentest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"os"
"path/filepath"
"strings"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -14,6 +15,7 @@ func GoldenTest(t *testing.T, file string, content string) {
_ = os.MkdirAll(dir, os.ModePerm)
}
a := require.New(t)
content = strings.ReplaceAll(content, "\r\n", "\n")
if FileExists(file) {
expected, err := os.ReadFile(file)
a.NoError(err)
Expand Down

0 comments on commit 72f8023

Please sign in to comment.