MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / AddChild

Method AddChild

options/options.go:66–76  ·  view source on GitHub ↗

AddChild creates a new child Options that inherits from the current Options. If the current Options already has a child, it returns the existing child.

()

Source from the content-addressed store, hash-verified

64// AddChild creates a new child Options that inherits from the current Options.
65// If the current Options already has a child, it returns the existing child.
66func (o *Options) AddChild() *Options {
67 if o.child != nil {
68 return o.child
69 }
70
71 child := New()
72 child.main = o.Main()
73 o.child = child
74
75 return child
76}
77
78// Depth returns the depth of the Options in the hierarchy.
79// The main Options has a depth of 0, its child has a depth of 1, and so on.

Callers 3

TestPropagateMethod · 0.80
testNestedOptionsFunction · 0.80

Calls 2

MainMethod · 0.95
NewFunction · 0.70

Tested by 3

TestPropagateMethod · 0.64
testNestedOptionsFunction · 0.64