MCPcopy Create free account
hub / github.com/cel-expr/cel-go / findAlias

Method findAlias

common/containers/container.go:154–168  ·  view source on GitHub ↗

findAlias takes a name as input and returns an alias expansion if one exists. If the name is qualified, the first component of the qualified name is checked against known aliases. Any alias that is found in a qualified name is expanded in the result: alias: R -> my.alias.R name: R.S.T output: m

(name string)

Source from the content-addressed store, hash-verified

152//
153// Note, the name must not have a leading dot.
154func (c *Container) findAlias(name string) (string, bool) {
155 // If an alias exists for the name, ensure it is searched last.
156 simple := name
157 qualifier := ""
158 dot := strings.Index(name, ".")
159 if dot >= 0 {
160 simple = name[0:dot]
161 qualifier = name[dot:]
162 }
163 alias, found := c.AliasSet()[simple]
164 if !found {
165 return "", false
166 }
167 return alias + qualifier, true
168}
169
170// ContainerOption specifies a functional configuration option for a Container.
171//

Callers 1

ResolveCandidateNamesMethod · 0.95

Implementers 7

baseMapcommon/types/map.go
protoMapcommon/types/map.go
proxyLegacyMapcommon/types/map_test.go
proxyLegacyListcommon/types/list_test.go
Unknowncommon/types/unknown.go
baseListcommon/types/list.go
concatListcommon/types/list.go

Calls 2

AliasSetMethod · 0.95
IndexMethod · 0.80

Tested by

no test coverage detected