package patterns type Noodle struct { Type string Name string Length int Girth int } type NoodleMaker struct { noodle Noodle } func newNoodleMaker() *NoodleMaker { return &NoodleMaker{ noodle: Noodle{"Röhre", "Fusili", 10, 5}, } } func (b *NoodleMaker) Length(l int) *NoodleMaker { b.noodle.Length = l return b } func (c *NoodleMaker) Girth(g int) *NoodleMaker { c.noodle.Girth = g return c } func (d *NoodleMaker) Name(n string) *NoodleMaker { d.noodle.Name = n return d } func (e *NoodleMaker) Type(t string) *NoodleMaker { e.noodle.Type = t return e }