DEV Community

Discussion on: Go - Learning 'for' loop statement in-depth

Collapse
aftertale profile image
Aftertale

You missed the for range loop:

for i, v, := range someSlice {
    fmt.Fprintf(os.Stdout, value of index %d is %s, i, v)
}
Enter fullscreen mode Exit fullscreen mode
Collapse
eternal_dev profile image
Eternal Dev Author

Thanks for the adding this