(path string)
| 357 | const separator = string(filepath.Separator) |
| 358 | |
| 359 | func ensureLeadingSlash(path string) string { |
| 360 | if path == "" || path[0] == '/' { |
| 361 | return path |
| 362 | } |
| 363 | |
| 364 | return "/" + path |
| 365 | } |
| 366 | |
| 367 | // toUnsafeChar returns a *C.char pointing at the backing bytes the Go string. |
| 368 | // If C does not store the string, it may be passed directly in a Cgo call (most efficient). |
no outgoing calls