MCPcopy
hub / github.com/tidwall/gjson / nameOfLast

Function nameOfLast

gjson.go:1986–1998  ·  view source on GitHub ↗

nameOfLast returns the name of the last component

(path string)

Source from the content-addressed store, hash-verified

1984
1985// nameOfLast returns the name of the last component
1986func nameOfLast(path string) string {
1987 for i := len(path) - 1; i >= 0; i-- {
1988 if path[i] == '|' || path[i] == '.' {
1989 if i > 0 {
1990 if path[i-1] == '\\' {
1991 continue
1992 }
1993 }
1994 return path[i+1:]
1995 }
1996 }
1997 return path
1998}
1999
2000func isSimpleName(component string) bool {
2001 for i := 0; i < len(component); i++ {

Callers 1

GetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…