15 lines
225 B
Go
15 lines
225 B
Go
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func main() {
|
||
|
var arr []int
|
||
|
for i := 0; i < 10; i++ {
|
||
|
arr = append(arr, i)
|
||
|
}
|
||
|
fmt.Println(arr)
|
||
|
fmt.Println(arr[:0], arr[0:])
|
||
|
fmt.Println(arr[:4], arr[4:])
|
||
|
fmt.Println(arr[:15], arr[15:])
|
||
|
}
|