nextSegment splits path at the first '/' returning (segment, remainder). The leading '/' in remainder is consumed.
(path string)
| 255 | // nextSegment splits path at the first '/' returning (segment, remainder). |
| 256 | // The leading '/' in remainder is consumed. |
| 257 | func nextSegment(path string) (seg, rest string) { |
| 258 | idx := strings.IndexByte(path, '/') |
| 259 | if idx == -1 { |
| 260 | return path, "" |
| 261 | } |
| 262 | return path[:idx], path[idx+1:] |
| 263 | } |
| 264 | |
| 265 | // segSep returns "/" + rest when rest is non-empty, so segments can be |
| 266 | // rejoined correctly during split/insert operations. |
no outgoing calls
no test coverage detected