Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
acf4dd4d
Commit
acf4dd4d
authored
Dec 02, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the naming example from Vector to Ring due to loss of vector.New()
R=rsc CC=golang-dev
https://golang.org/cl/164082
parent
ccd02648
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
effective_go.html
doc/effective_go.html
+5
-5
No files found.
doc/effective_go.html
View file @
acf4dd4d
...
...
@@ -308,12 +308,12 @@ which is a clear, concise name.
Moreover,
because imported entities are always addressed with their package name,
<code>
bufio.Reader
</code>
does not conflict with
<code>
io.Reader
</code>
.
Similarly, the function to make new instances of
<code>
vector.Vector
</code>
—
which
Similarly, the function to make new instances of
<code>
ring.Ring
</code>
—
which
is the definition of a
<em>
constructor
</em>
in Go
—
would
normally be called
<code>
New
Vector
</code>
, but since
<code>
Vector
</code>
is the only type exported by the package, and since the
package is called
<code>
vector
</code>
, it's called just
<code>
New
</code>
.
Clients of the package see that as
<code>
vector
.New
</code>
.
normally be called
<code>
New
Ring
</code>
, but since
<code>
Ring
</code>
is the only type exported by the package, and since the
package is called
<code>
ring
</code>
, it's called just
<code>
New
</code>
.
Clients of the package see that as
<code>
ring
.New
</code>
.
Use the package structure to help you choose good names.
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment