点击运行
package main import ( "fmt" ) func main() { message := "We produce 100%% organic %s\n" foods := []string{"vegetables", "fruit", "meat", "fish"} for _, food := range foods { fmt.Printf(message, food) } }
运行结果 :
正在执行...