Source File
strings.go
Belonging Package
google.golang.org/protobuf/internal/strs
package strs
import (
)
func ( protoreflect.FieldDescriptor) bool {
if flags.ProtoLegacy {
if , := .(interface{ () bool }); {
return .()
}
}
return .Syntax() == protoreflect.Proto3
}
case == '.':
= append(, '_') // convert '.' to '_'
= append(, 'X') // convert '_' to 'X'
case isASCIIDigit():
= append(, )
if isASCIILower() {
-= 'a' - 'A' // convert lowercase to uppercase
}
= append(, )
for ; +1 < len() && isASCIILower([+1]); ++ {
= append(, [+1])
}
}
}
return string()
}
func (, string) string {
:= // original input
for len() > 0 && len() > 0 {
if [0] == '_' {
= [1:]
continue
}
if unicode.ToLower(rune([0])) != rune([0]) {
return // no prefix match
}
, = [1:], [1:]
}
if len() > 0 {
return // no prefix match
}
= strings.TrimLeft(, "_")
if len() == 0 {
return // avoid returning empty string
}
return
}
func ( byte) bool {
return 'a' <= && <= 'z'
}
func ( byte) bool {
return 'A' <= && <= 'Z'
}
func ( byte) bool {
return '0' <= && <= '9'
![]() |
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. |