If you see `foo.bar()` it is definitely a method, as a package-scoped `bar`
function would not be exported so it would not be visible in other packages.
If, on the other hand, you see `foo.Bar()`, there is no easy way to tell.
You have to know if `foo` is a variable or a package in the given scope.

On Tue, Apr 4, 2023 at 7:20 AM joseph.p...@gmail.com <
joseph.p.mcguc...@gmail.com> wrote:

> When I’m reading go source and I see something like foo.bar(), my brain
> stutters for a second while I’m trying to determine if this is a reference
> to a package function or a receiver/method. Is there an easy way to make
> this determination?
>
> Thanks
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/e33c9734-4d83-4e21-9a95-b23be5e5a9bcn%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/e33c9734-4d83-4e21-9a95-b23be5e5a9bcn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGP9yVmrNJqv9-5A%2Bir21bLd%3DS54OFXS%2Bej22TF__6xcw%40mail.gmail.com.

Reply via email to