Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
var p *int // declare p to be a pointer to an int
|
||||
i = &p // assign i to be the int value pointed to by p
|
||||
|
|
@ -0,0 +1 @@
|
|||
var m map[string]int
|
||||
|
|
@ -0,0 +1 @@
|
|||
m := make(map[string]int)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
b := []byte(“hello world”)
|
||||
c := b
|
||||
c[0] = 'H'
|
||||
fmt.Println(string(b))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func three() *int {
|
||||
i := 3
|
||||
return &i // valid. no worry, no crash.
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
type pt struct {
|
||||
x, y int
|
||||
}
|
||||
|
||||
return &pt{22, 79} // allocates a pt object and returns a pointer to it.
|
||||
Loading…
Add table
Add a link
Reference in a new issue