FAQ
I note that the VAST majority of packages (on godoc.org for example) begin
with a lowercase letter. However the language and implementation allows
uppercase package names. Is there any downside to using an uppercase pkg
name? I've only got a few with leading uppercase, but one of them I use
frequently and I don't want to get too far downstream and find there's a
subtle problem with that choice.

Thanks in advance.

--
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/groups/opt_out.

Search Discussions

  • Andrew Gerrand at Feb 2, 2014 at 2:43 pm
    No technical reason that I'm aware of, but it does defy convention. That
    harms readability.

    Andrew

    On 2 February 2014 15:35, Hotei wrote:

    I note that the VAST majority of packages (on godoc.org for example)
    begin with a lowercase letter. However the language and implementation
    allows uppercase package names. Is there any downside to using an
    uppercase pkg name? I've only got a few with leading uppercase, but one of
    them I use frequently and I don't want to get too far downstream and find
    there's a subtle problem with that choice.

    Thanks in advance.

    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
  • Dave Cheney at Feb 2, 2014 at 9:51 pm
    Mixed case causes all sorts of issues on windows and OSX. On those systems Package and package refer to the same thing.
    On 3 Feb 2014, at 1:42, Andrew Gerrand wrote:

    No technical reason that I'm aware of, but it does defy convention. That harms readability.

    Andrew

    On 2 February 2014 15:35, Hotei wrote:
    I note that the VAST majority of packages (on godoc.org for example) begin with a lowercase letter. However the language and implementation allows uppercase package names. Is there any downside to using an uppercase pkg name? I've only got a few with leading uppercase, but one of them I use frequently and I don't want to get too far downstream and find there's a subtle problem with that choice.

    Thanks in advance.
    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
  • Francisco Souza at Feb 3, 2014 at 12:40 am

    On Sun, Feb 2, 2014 at 7:51 PM, Dave Cheney wrote:
    Mixed case causes all sorts of issues on windows and OSX. On those systems
    Package and package refer to the same thing.
    It get's worse: it's optional on osx.

    --
    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/groups/opt_out.
  • Jan Mercl at Feb 2, 2014 at 3:16 pm
    On Sun, Feb 2, 2014 at 3:35 PM, Hotei wrote:

    Expanding on Andrew's reply: Uppercase signals "exported entity" (in
    the first approximation). However, in the case we're discussing it
    doesn't mean that, so I think it introduces cognitive noise. IMHO,
    upper case package qualifiers should be thus avoided.

    Example of how it matters at eg.
    https://github.com/robertkrimen/otto/issues/41#issuecomment-33888773

    -j

    --
    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/groups/opt_out.
  • Hotei at Feb 2, 2014 at 4:19 pm
    Thanks to Andrew and Jan for your quick response. I think those are both
    good points. Looks like I have a few changes to make.
    On Sunday, February 2, 2014 9:35:05 AM UTC-5, Hotei wrote:

    I note that the VAST majority of packages (on godoc.org for example)
    begin with a lowercase letter. However the language and implementation
    allows uppercase package names. Is there any downside to using an
    uppercase pkg name? I've only got a few with leading uppercase, but one of
    them I use frequently and I don't want to get too far downstream and find
    there's a subtle problem with that choice.

    Thanks in advance.
    --
    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/groups/opt_out.
  • Hotei at Feb 3, 2014 at 2:54 am
    Seeking clarity on this - would a camelCase package name cause the same
    issues? Sounds like it would, but I both camel and upper named packages in
    a mixed go environment (65% Linux, 30% FreeBSD, 5% Windows7) and have yet
    to run into any problems. Several of my utility package names are
    camelCase and the most frequently used one is upper only. I'm changing
    them to increase interoperability, but it it's this big an issue maybe go
    vet needs to bark about it? Since it's legal (spec-wise) that may be about
    all one can hope for.

    I'm also assuming this conventional proscription on mixed case also applies
    to the import path as well as the package name.


    --
    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/groups/opt_out.
  • Caleb Spare at Feb 3, 2014 at 2:59 am
    The convention is for package names to be a single word.

    If they cannot be, they are written in all-lowercase without any separation
    between words. In the stdlib:

    index/suffixarray
    text/tabwriter

    The only common exception I'm aware of is putting tests in a foo_test
    package (if it's decided not to just put them in package foo directly).

    -Caleb

    On Sun, Feb 2, 2014 at 6:54 PM, Hotei wrote:

    Seeking clarity on this - would a camelCase package name cause the same
    issues? Sounds like it would, but I both camel and upper named packages in
    a mixed go environment (65% Linux, 30% FreeBSD, 5% Windows7) and have yet
    to run into any problems. Several of my utility package names are
    camelCase and the most frequently used one is upper only. I'm changing
    them to increase interoperability, but it it's this big an issue maybe go
    vet needs to bark about it? Since it's legal (spec-wise) that may be about
    all one can hope for.

    I'm also assuming this conventional proscription on mixed case also
    applies to the import path as well as the package name.


    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
  • Dave Cheney at Feb 3, 2014 at 3:09 am
    The only safe case is lower case.

    On Mon, Feb 3, 2014 at 1:54 PM, Hotei wrote:

    Seeking clarity on this - would a camelCase package name cause the same
    issues? Sounds like it would, but I both camel and upper named packages in
    a mixed go environment (65% Linux, 30% FreeBSD, 5% Windows7) and have yet
    to run into any problems. Several of my utility package names are
    camelCase and the most frequently used one is upper only. I'm changing
    them to increase interoperability, but it it's this big an issue maybe go
    vet needs to bark about it? Since it's legal (spec-wise) that may be about
    all one can hope for.

    I'm also assuming this conventional proscription on mixed case also
    applies to the import path as well as the package name.


    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
  • Cao Nguyên at Feb 3, 2014 at 10:53 am
    IMHO, package name in general is the most common thing you type. A lazy guy
    like me don't like to press 'Shift' too many times. Sound stupid is it!? :D
    (anyway you have alot of smart responses allready)
    On Sunday, February 2, 2014 9:35:05 PM UTC+7, Hotei wrote:

    I note that the VAST majority of packages (on godoc.org for example)
    begin with a lowercase letter. However the language and implementation
    allows uppercase package names. Is there any downside to using an
    uppercase pkg name? I've only got a few with leading uppercase, but one of
    them I use frequently and I don't want to get too far downstream and find
    there's a subtle problem with that choice.

    Thanks in advance.
    --
    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/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 2, '14 at 2:35p
activeFeb 3, '14 at 10:53a
posts10
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase