How can I set one pointer to multiply function?
package main
import "fmt"
type Cube struct {
u int
}
func (h *Cube) space() int {
return h.u * h.u * h.u
}
func main() {
h := Cube {
u: 10,
}
fmt.Println(h.space())
h := Cube {
u: 100,
}
fmt.Println(h.space())
}
The first request of println give back 1000, but with the second println it goes wrong telling no new variables on left side of := but I want the pointer to use all same just the u: to 100 change