"fmt" var ( example = []string{"golang", "hands-on", "in", "kagawa"} ) func main() { var datas []string datas = example for _, v := range datas { fmt.Println(v) } } 22
方 var example = []string{"golang", "hands-on", "in", "kagawa"} func main() { var datas []string datas = example for _, v := range datas { fmt.Println(v) fmt.Print("input : ") var ans string fmt.Scanln(&ans) if v == ans { fmt.Println("◦") } else { fmt.Println("×") } } } 38