MCPcopy
hub / github.com/caddyserver/caddy / Get

Method Get

replacer.go:100–107  ·  view source on GitHub ↗

Get gets a value from the replacer. It returns the value and whether the variable was known.

(variable string)

Source from the content-addressed store, hash-verified

98// Get gets a value from the replacer. It returns
99// the value and whether the variable was known.
100func (r *Replacer) Get(variable string) (any, bool) {
101 for _, mapFunc := range r.providers {
102 if val, ok := mapFunc.replace(variable); ok {
103 return val, true
104 }
105 }
106 return nil, false
107}
108
109// GetString is the same as Get, but coerces the value to a
110// string representation as efficiently as possible.

Callers 2

GetStringMethod · 0.95
replaceMethod · 0.95

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected