func main() { // Default ball b := ball.New() fmt.Println(b.Color()) // Red ball r := redball.New() fmt.Println(r.Color()) // Green ball g := greenball.New() fmt.Println(g.Color()) // Beachball which is actually the default ball e := beachball.New() fmt.Println(e.Color()) }
// New creates a new ball func New() *ball.Ball { b := ball.New() return b }
// New creates a new ball func New() *ball.Ball { b := ball.New() b.SetColor("green") return b }
// New creates a new ball func New() *ball.Ball { b := ball.New() b.SetColor("red") return b }