added a few more things to the slices example
This commit is contained in:
parent
e26ef31903
commit
c94a5c6613
@ -18,8 +18,12 @@ func main() {
|
||||
fmt.Println("p[:3] == ", p[:3])
|
||||
fmt.Println("p[4:] == ", p[4:])
|
||||
|
||||
v := make([]string, 0)
|
||||
v := make([]string, 30, 1024)
|
||||
fmt.Printf("%v\n", v)
|
||||
fmt.Printf("%v\n", cap(v))
|
||||
v = append(v, "hello", "world")
|
||||
fmt.Printf("%v\n", v)
|
||||
|
||||
界 := 12.34
|
||||
fmt.Printf("%v\n", 界)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user