11
11
// Expand replaces ${var} or $var in the string based on the mapping function.
13
13
func Expand(s string, mapping func(string) string) string {
14
14
buf := make([]byte, 0, 2*len(s))
15
15
// ${} is all ASCII, so bytes are fine for this operation.