Last active
February 8, 2016 00:27
-
-
Save lleo/f1945d6be1cc3cabdf55 to your computer and use it in GitHub Desktop.
slice limit & args array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func showArgs(args ...int) { | |
fmt.Println(args) | |
} | |
func main() { | |
//n := []byte{0, 1, 2, 3, 4} //odd | |
n := []byte{0, 1, 2, 3} //even | |
l := n[:len(n)/2] | |
r := n[len(n)/2:] | |
fmt.Println(n) | |
fmt.Println(len(n)/2) | |
fmt.Println(l) | |
fmt.Println(r) | |
showArgs(1,2,3) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment