Re: [go-nuts] Is it necessary to start function names within main package with capitalized letter?

2020-07-02 Thread Jake Montgomery
On Wednesday, June 24, 2020 at 12:46:42 PM UTC-4, Axel Wagner wrote:
>
> Personally, I tend to do it. Note that it doesn't actually make a 
> difference from a technical perspective - main can't be imported, so it 
> makes no real sense to export any identifiers. 
>
 
There is a case where main can be imported. You can import main from a test 
in the same directory, but with a different package name. AFAICT, this 
allows 'external' testing of executable code. In that case what identifiers 
are exported does matter. But since most of us will probably never use this 
feature, it probably does not matter much in practice. 

-- 
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/7e4c307f-cd98-453d-b8bd-e685062830b8o%40googlegroups.com.


Re: [go-nuts] Is it necessary to start function names within main package with capitalized letter?

2020-06-24 Thread 'K Richard Pixley' via golang-nuts

I generally do the reverse.

Everything is internal, lower case, until and unless I need it 
elsewhere.  Then I reevaluate where the boundaries should be at that time.


I often find that as an exported API, I need/want different things out 
of it than I did when it was internal.


--
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/43a478ef-4a4f-183f-daa5-1948a17a2e70%40juniper.net.


Re: [go-nuts] Is it necessary to start function names within main package with capitalized letter?

2020-06-24 Thread 'Axel Wagner' via golang-nuts
Personally, I tend to do it. Note that it doesn't actually make a
difference from a technical perspective - main can't be imported, so it
makes no real sense to export any identifiers. As such, the boundaries of
what I "export" are somewhat more fluent than usual. But yeah, as you said,
for clarity, I tend to emphasize the most important functions this way.
Also, I usually *intend* to factor more stuff out of the main package over
time, as it makes sense (so I start with main and then split it up further
and further) and the same functions then end up being the natural API
points to make that split and it's nice to ear-mark them ahead of time.

At the end of the day, it's just preference and so there's even less of a
"right" or "wrong" answer than usual. Just do it like you prefer, as long
as your team is fine with it :)

On Wed, Jun 24, 2020 at 6:05 PM Alvin Cao  wrote:

> Hello everyone.
>
> My program has just one package, i.e., main package. But the functions
> still might be different. Some are supposed to be interfaces while others
> are just ‘internal’. In this case, should I start these interfaces with
> capitalized letters just for clearness? Thank you.
>
> --
> 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/abc571c5-0319-4c49-af1a-6a9bd5c91838o%40googlegroups.com
> 
> .
>

-- 
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/CAEkBMfHeNuutt4vbAF2eXM6AetXOzkKvpQCk2%2BAe-9B%3DkbxXKg%40mail.gmail.com.