@@ -13,6 +13,7 @@ import (
13
13
"io/fs"
14
14
"os"
15
15
"path/filepath"
16
+ "runtime"
16
17
"slices"
17
18
"sort"
18
19
"strings"
@@ -217,7 +218,7 @@ func TestAllDependencies(t *testing.T) {
217
218
}
218
219
// TODO(golang.org/issue/43440): Check anything else influenced by dependency versions.
219
220
220
- diff , err := testenv .Command (t , "diff" , "--recursive" , "--no-dereference" , "-- unified" , r .Dir , m .Dir ).CombinedOutput ()
221
+ diff , err := testenv .Command (t , "diff" , "--recursive" , "--unified" , r .Dir , m .Dir ).CombinedOutput ()
221
222
if err != nil || len (diff ) != 0 {
222
223
t .Errorf (`Module %s in %s is not tidy (-want +got):
223
224
@@ -284,6 +285,18 @@ func makeGOROOTCopy(t *testing.T) string {
284
285
return err
285
286
}
286
287
perm = info .Mode () & os .ModePerm
288
+
289
+ // dup symlink
290
+ target , err := os .Readlink (src )
291
+ if err != nil {
292
+ return err
293
+ }
294
+ // create a symlink to the target directory
295
+ err = os .Symlink (target , dst )
296
+ if err != nil {
297
+ return err
298
+ }
299
+ return filepath .SkipDir
287
300
}
288
301
289
302
// If it's a directory, make a corresponding directory.
@@ -311,6 +324,9 @@ func makeGOROOTCopy(t *testing.T) string {
311
324
return d .Close ()
312
325
})
313
326
if err != nil {
327
+ if _ , ok := err .(* os.LinkError ); ok && runtime .GOOS == "windows" {
328
+ t .Skipf ("skipping because of symlink error on Windows: %v" , err )
329
+ }
314
330
t .Fatal (err )
315
331
}
316
332
t .Logf ("copied GOROOT from %s to %s" , testenv .GOROOT (t ), gorootCopyDir )
0 commit comments