MCPcopy Create free account
hub / github.com/barnybug/cli53 / shortenName

Function shortenName

util.go:375–380  ·  view source on GitHub ↗

Use shortened form of name with origin removed/abbreviated.

(name, origin string)

Source from the content-addressed store, hash-verified

373
374// Use shortened form of name with origin removed/abbreviated.
375func shortenName(name, origin string) string {
376 if name == origin {
377 return "@"
378 }
379 return strings.TrimSuffix(name, "."+origin)
380}
381
382var reQuotedValue = regexp.MustCompile(`"((?:\\"|[^"])*)"`)
383var reBackslashed = regexp.MustCompile(`\\(.)`)

Callers 3

UnexpandSelfAliasesFunction · 0.85
ExportBindToWriterFunction · 0.85
TestShortenNameFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestShortenNameFunction · 0.68