symlinkTestFile creates a symlink, or skips the test where that needs a privilege the system doesn't grant, as on Windows by default.
(t *testing.T, target, path string)
| 1587 | // symlinkTestFile creates a symlink, or skips the test where that needs a |
| 1588 | // privilege the system doesn't grant, as on Windows by default. |
| 1589 | func symlinkTestFile(t *testing.T, target, path string) { |
| 1590 | t.Helper() |
| 1591 | require.NoError(t, os.MkdirAll(filepath.Dir(path), 0755)) |
| 1592 | if err := os.Symlink(target, path); err != nil { |
| 1593 | t.Skipf("cannot create a symlink here: %v", err) |
| 1594 | } |
| 1595 | } |
no test coverage detected