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

Method Extend

common/containers/container.go:60–82  ·  view source on GitHub ↗

Extend creates a new Container with the existing settings and applies a series of ContainerOptions to further configure the new container.

(opts ...ContainerOption)

Source from the content-addressed store, hash-verified

58// Extend creates a new Container with the existing settings and applies a series of
59// ContainerOptions to further configure the new container.
60func (c *Container) Extend(opts ...ContainerOption) (*Container, error) {
61 if c == nil {
62 return NewContainer(opts...)
63 }
64 // Copy the name and aliases of the existing container.
65 ext := &Container{name: c.Name()}
66 if len(c.AliasSet()) > 0 {
67 aliasSet := make(map[string]string, len(c.AliasSet()))
68 for k, v := range c.AliasSet() {
69 aliasSet[k] = v
70 }
71 ext.aliases = aliasSet
72 }
73 // Apply the new options to the container.
74 var err error
75 for _, opt := range opts {
76 ext, err = opt(ext)
77 if err != nil {
78 return nil, err
79 }
80 }
81 return ext, nil
82}
83
84// Name returns the fully-qualified name of the container.
85//

Callers 5

TestContainers_AliasFunction · 0.45
TestContainers_AbbrevsFunction · 0.45
initFunction · 0.45

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 3

NameMethod · 0.95
AliasSetMethod · 0.95
NewContainerFunction · 0.85

Tested by 5

TestContainers_AliasFunction · 0.36
TestContainers_AbbrevsFunction · 0.36
initFunction · 0.36