将 cars 数组中的 "Volvo" 值更改为 "Opel"。
package main import ("fmt") func main() { var cars = [4]string{"Volvo", "BMW", "Ford", "Mazda"} @(7) = @(6) fmt.Print(cars) }
package main import ("fmt") func main() { var cars = [4]string{"Volvo", "BMW", "Ford", "Mazda"} cars[0] = "Opel" fmt.Print(cars) }