Is it possible to include values in the declaration of a new
type.
type Vertex struct {
X, Y int
}
func main() {
v := new( Vertex{ 0, 0} ) // Like so
fmt.Println( v )
// Instead of :
v = new(Vertex)
v.X, v.Y = 12, 4 // extra line for initializing the values of X and Y
fmt.Println( v )
}
Or because go makes the "Vertex{val, val} " a literal value instead of a basic Vertex type it's not possible?