(path string)
| 177 | } |
| 178 | |
| 179 | func pathToArray(path string) []string { |
| 180 | out := strings.FieldsFunc(path, func(r rune) bool { |
| 181 | return r == os.PathSeparator |
| 182 | }) |
| 183 | // Drive letters on Windows have a trailing separator as part of their name. |
| 184 | // i.e. `os.Open("C:")` does not work, but `os.Open("C:\\")` does. |
| 185 | if runtime.GOOS == "windows" && len(out) > 0 { |
| 186 | out[0] += string(os.PathSeparator) |
| 187 | } |
| 188 | return out |
| 189 | } |
no outgoing calls