platformAbsPath constructs an absolute path that is valid on the current platform. On Windows paths must include a drive letter to be considered absolute.
(parts ...string)
| 14 | // on the current platform. On Windows paths must include a |
| 15 | // drive letter to be considered absolute. |
| 16 | func platformAbsPath(parts ...string) string { |
| 17 | if runtime.GOOS == "windows" { |
| 18 | return `C:\` + filepath.Join(parts...) |
| 19 | } |
| 20 | return "/" + filepath.Join(parts...) |
| 21 | } |
| 22 | |
| 23 | func TestResolvePath(t *testing.T) { //nolint:tparallel // subtests using t.Setenv cannot be parallel |
| 24 | t.Run("EmptyInput", func(t *testing.T) { |
no outgoing calls
no test coverage detected