mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-08-03 05:02:16 +02:00
initial import
This commit is contained in:
22
golang-language-samples/collection-for-range/collection.go
Normal file
22
golang-language-samples/collection-for-range/collection.go
Normal file
@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
//Array mit fester Größe
|
||||
var months = [12]string{"Januar",
|
||||
"Februar", "März", "April",
|
||||
"Mai", "Juni", "Juli", "August",
|
||||
"September", "Oktober", "November",
|
||||
"Dezember"}
|
||||
for i, month := range months {
|
||||
fmt.Printf("%v: %v\n", i, month)
|
||||
}
|
||||
|
||||
q2 := months[3:6]
|
||||
for i, month := range q2 {
|
||||
fmt.Printf("%v: %v\n", i, month)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user