diff --git a/src/os/os_test.go b/src/os/os_test.go index 4124be13cc542..3721e15027d5b 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -252,9 +252,11 @@ func TestLstat(t *testing.T) { if !equal(sfname, dir.Name()) { t.Error("name should be ", sfname, "; is", dir.Name()) } - filesize := size(path, t) - if dir.Size() != filesize { - t.Error("size should be", filesize, "; is", dir.Size()) + if dir.Mode()&ModeSymlink == 0 { + filesize := size(path, t) + if dir.Size() != filesize { + t.Error("size should be", filesize, "; is", dir.Size()) + } } }