FAQ
Exported functions can return unexported types. I don't mean in interface
wrappers over unexported structs, I mean naked unexported types. I can't
think of any sane reason to do this, I don't think it's error-worthy (and
it would break the guarantee anyway), but this feels like something go vet
should complain about. Is there a use for this I'm not aware of?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Jul 11, 2014 at 5:43 pm

    On Fri, Jul 11, 2014 at 10:07 AM, Jsor wrote:
    Exported functions can return unexported types. I don't mean in interface
    wrappers over unexported structs, I mean naked unexported types. I can't
    think of any sane reason to do this, I don't think it's error-worthy (and it
    would break the guarantee anyway), but this feels like something go vet
    should complain about. Is there a use for this I'm not aware of?
    You can use them in a limited way via constructs like
         v := p.F()
         p.G(v)

    I agree that they are not particularly useful but they aren't 100%
    useless.

    Ian

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 11, '14 at 5:07p
activeJul 11, '14 at 5:43p
posts2
users2
websitegolang.org

2 users in discussion

Ian Lance Taylor: 1 post Jsor: 1 post

People

Translate

site design / logo © 2021 Grokbase