On Fri, 1 Feb 2013, Brendan Tracey wrote:
> I don't understand why f2 compiles but f1 does not. Help understanding this
> error would be appreciated
Because []Datapoint is a type, not a value. You want
return []Datapoint{}, nil
When you write 'var a []Datapoint', that's equiv. to 'var a := []Datapoint{}'.
>
>
http://play.golang.org/p/S4n6Nff1W9
>
> --
> 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/groups/opt_out.
>
>
>
--
Scott Lawrence
go version go1.0.3
Linux baidar 3.7.4-1-ARCH #1 SMP PREEMPT Mon Jan 21 23:05:29 CET 2013 x86_64 GNU/Linux