Hacker News new | ask | show | jobs
by latchkey 780 days ago
Which IDE do you use? Mine would flag this as an error pretty quickly.
1 comments

Goland. How would an IDE know that you intended a struct field to be public or not?
Any non-private usage of a private struct is a compile error.

If you're using goland, it would report this as an error as it is effectively compiling your code as you write it.

Also, autocomplete wouldn't work when you tried to use the private struct.