MCPcopy Index your code
hub / github.com/coder/coder / extractBasename

Function extractBasename

agent/filefinder/text.go:84–98  ·  view source on GitHub ↗
(path []byte)

Source from the content-addressed store, hash-verified

82}
83
84func extractBasename(path []byte) (offset int, length int) {
85 end := len(path)
86 if end > 0 && path[end-1] == '/' {
87 end--
88 }
89 if end == 0 {
90 return 0, 0
91 }
92 i := end - 1
93 for i >= 0 && path[i] != '/' {
94 i--
95 }
96 start := i + 1
97 return start, end - start
98}
99
100func extractSegments(path []byte) [][]byte {
101 var segments [][]byte

Callers 1

AddMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected