Horje
golang loop through array Code Example
loop list golang
a := []string{"Foo", "Bar"}
for i, s := range a {
    fmt.Println(i, s)
}
golang loop through array
arr := []int{1, 2, 3, 4, 5}
//using range 
for index, ele := range arr { // you can escape index by _ keyword
	fmt.Println(index, ele)
}
go Iterating over an array in Golang
package main

import "fmt"

func main() {
    data := [...]string{"Ned", "Edd", "Jon", "Jeor", "Jorah"}
    for i := 0; i < len(data); i++ { //looping from 0 to the length of the array
        fmt.Printf("%d th element of data is %s\n", i, data[i])
    }
}




C

Related
hi servicenow Code Example hi servicenow Code Example
get current used proxy windows 7 Code Example get current used proxy windows 7 Code Example
tkinter create_line Code Example tkinter create_line Code Example
ruby absolute value Code Example ruby absolute value Code Example
how to mutex lock in c Code Example how to mutex lock in c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8