FAQ
Hi,
Why Go use name beginning with upper case to distinguish exported
variables, functions and types ?
I think it is not convenient if you want to change the scope of something.
You have to modify all the code to change the name with the risk to forget
one.

--
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

  • Patrick Mylund Nielsen at Mar 10, 2013 at 4:48 pm
    It just does.

    I think it's convenient that I know if something is exported when I'm using
    it. I always forget to X or Y function to the export list in other
    languages.

    On Sun, Mar 10, 2013 at 10:59 AM, wrote:

    Hi,
    Why Go use name beginning with upper case to distinguish exported
    variables, functions and types ?
    I think it is not convenient if you want to change the scope of something.
    You have to modify all the code to change the name with the risk to forget
    one.

    --
    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.
  • Rob Pike at Mar 10, 2013 at 4:49 pm
    You won't forget for long. The compiler will notice.

    http://talks.golang.org/2012/splash.article#TOC_11.

    -rob

    --
    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.
  • Beatithomas at Mar 10, 2013 at 5:08 pm
    Thanks, this is what I was looking for.

    Le dimanche 10 mars 2013 17:49:09 UTC+1, Rob Pike a écrit :
    You won't forget for long. The compiler will notice.

    http://talks.golang.org/2012/splash.article#TOC_11.

    -rob
    --
    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.
  • Archos at Mar 10, 2013 at 5:10 pm
    When you get used to use it, you will no want another way. In fact, I'm
    hoping that my another favourite language also uses that way.

    To change the name to all functions, use a tool like sed:

    find . -type f -name "*.go" |xargs sed 's/oldFunc/NewFunc/'

    El domingo, 10 de marzo de 2013 14:59:05 UTC, beati...@gmail.com escribió:
    Hi,
    Why Go use name beginning with upper case to distinguish exported
    variables, functions and types ?
    I think it is not convenient if you want to change the scope of something.
    You have to modify all the code to change the name with the risk to forget
    one.
    --
    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.
  • Carlos Castillo at Mar 10, 2013 at 9:28 pm
    I prefer to use gofmt:
    gofmt -r 'oldFunc->NewFunc' -w -l .
    On Sunday, March 10, 2013 10:10:23 AM UTC-7, Archos wrote:

    When you get used to use it, you will no want another way. In fact, I'm
    hoping that my another favourite language also uses that way.

    To change the name to all functions, use a tool like sed:

    find . -type f -name "*.go" |xargs sed 's/oldFunc/NewFunc/'

    El domingo, 10 de marzo de 2013 14:59:05 UTC, beati...@gmail.com escribió:
    Hi,
    Why Go use name beginning with upper case to distinguish exported
    variables, functions and types ?
    I think it is not convenient if you want to change the scope of
    something. You have to modify all the code to change the name with the risk
    to forget one.
    --
    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
postedMar 10, '13 at 4:46p
activeMar 10, '13 at 9:28p
posts6
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase