On Sat, Feb 3, 2018 at 9:36 AM,  <matthewju...@gmail.com> wrote:
> You need the package name.
>
> var a *common.Any

Yes.  Let me add that some people consider "common" to be a poor
choice for a package name.  See
https://github.com/golang/go/wiki/CodeReviewComments#package-names and
the links there.

Ian


> On Saturday, February 3, 2018 at 10:45:22 AM UTC-6, l vic wrote:
>>
>> I am trying to alias empty interface in one package so it could be used in
>> several other packages:
>> in "myproject/common/common.go"
>>
>> package common
>>
>> type Any interface{}
>>
>>
>> But when i try to use it from another package "myproject/myutil/myutil.go"
>>
>> package myutil
>>
>> import (
>>
>> "myproject/common"
>>
>> )
>>
>> var a *Any
>>
>>
>> I have compilation error:
>>
>> imported and not used: "myproject/common"
>>
>> undefined: Any
>>
>>
>> I declared type Any with capital 'A', so it's supposed to be visible from
>> other packages... Where's the error?
>
> --
> 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.

Reply via email to