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)
| 152 | // |
| 153 | // Note, the name must not have a leading dot. |
| 154 | func (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 | // |
no test coverage detected