cqspirit / go-tour

Automatically exported from code.google.com/p/go-tour
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

exported names: give examples of name declarations #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
https://feedback.corp.google.com/#/Report/973612605

Description:
How about including a short example package in the text.  Nothing elaborate, 
just enough to let the reader see what is meant

UI language: en
Detected language: en

Original issue reported on code.google.com by feedback...@gmail.com on 3 Jul 2013 at 8:19

GoogleCodeExporter commented 8 years ago
What kind of example?

Original comment by a...@golang.org on 4 Jul 2013 at 10:13

GoogleCodeExporter commented 8 years ago
Hope I have the capitalization and comments correct, but something like

package foobar

func foo() {
   //not exported, private method to the package
}

func Bar() {
   //exported, public method available outside the package
}

func foobar() {
   //required?????
}

Only foobar.Bar() is publicly available.

Then again, I'm only about one-third through the tour, and there doesn't
seem to be discussion about private vs. public, and maybe that's not a
distinction that has much importance in Go.  On the other hand, perhaps
I'll learn more in the "interface" section of the tour.

Original comment by craig.ca...@gmail.com on 4 Jul 2013 at 1:32

GoogleCodeExporter commented 8 years ago

Original comment by a...@golang.org on 10 Jul 2013 at 6:57