ApplyToSegment replaces shorthand placeholder to its full placeholder, understandable by Caddy.
(segment *caddyfile.Segment)
| 92 | |
| 93 | // ApplyToSegment replaces shorthand placeholder to its full placeholder, understandable by Caddy. |
| 94 | func (s ShorthandReplacer) ApplyToSegment(segment *caddyfile.Segment) { |
| 95 | if segment != nil { |
| 96 | for i := 0; i < len(*segment); i++ { |
| 97 | // simple string replacements |
| 98 | (*segment)[i].Text = s.simple.Replace((*segment)[i].Text) |
| 99 | // complex regexp replacements |
| 100 | for _, r := range s.complex { |
| 101 | (*segment)[i].Text = r.search.ReplaceAllString((*segment)[i].Text, r.replace) |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
no outgoing calls
no test coverage detected