package juice
type Juice struct{...}
func New() Juice {}
func FromApples(a []Apple) Juice {}
func FromOranges(o []Orange) Juice {}
juice:= new(Juice)
// ... process apples
return juice
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why do you need a prototype juice? I prefer the original implementation, it's clearer, less code, and has less allocation.
--
Hi Haddock,
The solution you provide is definitely not idiomatic.
I agree with David, what Olivier has looks good as is.
--