Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
da34bea9
Commit
da34bea9
authored
Mar 02, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redo poor example of slices.
R=rsc OCL=25614 CL=25614
parent
da38974c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
doc/go_spec.html
doc/go_spec.html
+4
-2
No files found.
doc/go_spec.html
View file @
da34bea9
...
@@ -1014,11 +1014,13 @@ make([]T, length, capacity)
...
@@ -1014,11 +1014,13 @@ make([]T, length, capacity)
</pre>
</pre>
<p>
<p>
produces the same slice as allocating an array and slicing it:
produces the same slice as allocating an array and slicing it, so these two examples
produce the same slice:
</p>
</p>
<pre>
<pre>
make([]T, capacity)[0 : length]
make([]int, 50, 100)
new([100]int)[0:50]
</pre>
</pre>
...
...
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