On 24 August 2012 08:47, atul <
atul...@iclinica.in> wrote:
> Dear all,
> I started learning go by taking the gotour...
> While running exercise #69
> "Exercise: Equivalent Binary Trees"
>
> If I say
> var t *tree = tree.New(4)
> I get an error...
>
> "./compile19.go:19: use of package tree not in selector"
`tree` is not a type name, it's a package name. I think
you mean *tree.Tree.
> However, if I change the line to
> t := tree.New(4)
(or var t = tree.New(4))
> it works fine..
Because you're not trying to use a package name as
a type name any more. t will get the type that tree.New's
result has.
Chris
--
Chris "allusive" Dollin