mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-05 12:00:16 +00:00
d7473ac185
Tidy files; tidy soul!
8 lines
266 B
Plaintext
8 lines
266 B
Plaintext
p := Vertex{1, 2} // p is a Vertex
|
|
q := &p // q is a pointer to a Vertex
|
|
r := &Vertex{1, 2} // r is also a pointer to a Vertex
|
|
|
|
// The type of a pointer to a Vertex is *Vertex
|
|
// new creates a pointer to a new struct instance
|
|
var s *Vertex = new(Vertex)
|