Source File
path.go
Belonging Package
path
package path
type lazybuf struct {
s string
buf []byte
w int
}
func ( *lazybuf) ( int) byte {
if .buf != nil {
return .buf[]
}
return .s[]
}
func ( *lazybuf) ( byte) {
if .buf == nil {
if .w < len(.s) && .s[.w] == {
.w++
return
}
.buf = make([]byte, len(.s))
copy(.buf, .s[:.w])
}
.buf[.w] =
.w++
}
func ( *lazybuf) () string {
if .buf == nil {
return .s[:.w]
}
return string(.buf[:.w])
}
++
++
+= 2
switch {
for ; < && [] != '/'; ++ {
.append([])
}
}
}
if := lastSlash(); >= 0 {
= [+1:]
if == "" {
return "/"
}
return
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |