Skip to content

Commit f467aa2

Browse files
committed
review
1 parent 9597740 commit f467aa2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/goformat/runner_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ package goformat
33
import (
44
"os"
55
"path/filepath"
6+
"runtime"
67
"testing"
78

89
"github.com/stretchr/testify/assert"
910
"github.com/stretchr/testify/require"
1011

1112
"github.com/golangci/golangci-lint/v2/pkg/config"
13+
"github.com/golangci/golangci-lint/v2/pkg/fsutils"
1214
)
1315

1416
func TestRunnerOptions_MatchAnyPattern(t *testing.T) {
@@ -117,8 +119,17 @@ func TestRunnerOptions_MatchAnyPattern_withSymlinks(t *testing.T) {
117119
},
118120
},
119121
}
122+
120123
cfg.SetConfigDir(realDir)
121124

125+
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
126+
// IMPORTANT: On macOS, `tmpDir` might be` /var/..`. which is itself a symlink to `/private/var/...`
127+
resolvedBasePath, errEval := fsutils.EvalSymlinks(realDir)
128+
require.NoError(t, errEval)
129+
130+
cfg.SetConfigDir(resolvedBasePath)
131+
}
132+
122133
opts, err := NewRunnerOptions(cfg, false, false, false)
123134
require.NoError(t, err)
124135

0 commit comments

Comments
 (0)