原文:
Exercise 5.9: Write a function expand(s string, f func(string) string) string that replaces each substring “$foo” within s by the text returned by f("foo").
翻译:
编写函数expand,将s中的"foo"替换为f("foo")的返回值。
func expand(s string, f func(string) string) string
主要是翻译里 $foo 缺少了$,让人无法理解题意