I believe the code listed in https://gobyexample.com/for causes an error. When copy pasting the code into a main.go file and running the code by go run main.go I get two errors instead of the assumed output seen in on the left side of the code.
Output:
# command-line-arguments
./main.go:17:20: cannot range over 3 (untyped int constant)
./main.go:26:20: cannot range over 6 (untyped int constant)
Hi!
I believe the code listed in https://gobyexample.com/for causes an error. When copy pasting the code into a
main.go
file and running the code bygo run main.go
I get two errors instead of the assumed output seen in on the left side of the code.Output:
Go version:
go version go1.21.7 darwin/arm64