They didn't say *r2 := *r; he said r2 := *r. Also read the example. They returned &r instead of r. The code is equivalent but shorter than the code in the package.
On Sat, Feb 18, 2017 at 2:32 PM Dan Kortschak <dan.kortsc...@adelaide.edu.au> wrote: > On Fri, 2017-02-17 at 22:59 -0800, vova...@gmail.com wrote: > > I'm wondering, if there's any benefit of writing* r2 := new(Request); > > *r2 = *r *rather than shorter *r2 := *r (example below) *or this is > > just matter of style preference? > > *r2 := *r is not legal. > > https://play.golang.org/p/28y-zWhvoQ > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.