I come from a C++ background and I\'m used to using the std::vector
class for things like this.
Lets assume I want a dynamic array of these:
typ
Hi we can simply do this in two ways
type mytype struct {
a, b int
}
Just do like this
__
a := []mytype{mytype{1, 2}, mytype{3, 4}, mytype{4, 5}}
__
a:= append([]mytype{}, mytype{1, 2}, mytype{3, 4}, mytype{4, 5})
Add as much as you want. First one is an easy way to do this. Hope this will help you.