Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(349)

Issue 7423051: code review 7423051: doc/effective_go.html: update slices and maps. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by r
Modified:
8 years, 7 months ago
Reviewers:
jondb, rsc
CC:
rsc1, rsc
Visibility:
Public.

Description

doc/effective_go.html: update slices and maps. Drop the phrase "reference types", which has caused confusion. Add a section about 2D arrays, a common newbie question.

Patch Set 1 #

Total comments: 2

Patch Set 2 : diff -r 9742f722b558 https://code.google.com/p/go/ #

Total comments: 4

Patch Set 3 : diff -r 866f0a07de2d https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -16 lines) Patch
M doc/effective_go.html View 1 2 10 chunks +88 lines, -16 lines 0 comments Download

Messages

Total messages: 8
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years, 3 months ago (2013-03-04 23:52:29 UTC) #1
cespare
https://codereview.appspot.com/7423051/diff/1/doc/effective_go.html File doc/effective_go.html (right): https://codereview.appspot.com/7423051/diff/1/doc/effective_go.html#newcode1432 doc/effective_go.html:1432: If the slices might grown or shrink, they should ...
12 years, 3 months ago (2013-03-05 02:45:02 UTC) #2
adg
https://codereview.appspot.com/7423051/diff/1/doc/effective_go.html File doc/effective_go.html (right): https://codereview.appspot.com/7423051/diff/1/doc/effective_go.html#newcode1456 doc/effective_go.html:1456: array := make([]uint8, XSize*YSize) // Has type []uint8 even ...
12 years, 3 months ago (2013-03-05 03:25:56 UTC) #3
r
Hello golang-dev@googlegroups.com, cespare@gmail.com, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 3 months ago (2013-03-05 07:23:52 UTC) #4
rsc
LGTM https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html File doc/effective_go.html (right): https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html#newcode1258 doc/effective_go.html:1258: of the value explicitly. what is "the value" ...
12 years, 3 months ago (2013-03-05 22:09:52 UTC) #5
r
*** Submitted as https://code.google.com/p/go/source/detail?r=db54b7c5b3e4 *** doc/effective_go.html: update slices and maps. Drop the phrase "reference types", ...
12 years, 3 months ago (2013-03-05 22:13:59 UTC) #6
jondb
Question inline on this change - need more info. https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html File doc/effective_go.html (right): https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html#newcode1459 doc/effective_go.html:1459: ...
8 years, 7 months ago (2016-10-16 18:26:26 UTC) #7
jondb
8 years, 7 months ago (2016-10-16 18:35:40 UTC) #8
Message was sent while issue was closed.
On 2016/10/16 18:26:26, jondb wrote:
> Question inline on this change - need more info.
> 
> https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html
> File doc/effective_go.html (right):
> 
>
https://codereview.appspot.com/7423051/diff/6001/doc/effective_go.html#newcod...
> doc/effective_go.html:1459: picture[i] = pixels[i*XSize:(i+1)*XSize]
> On 2013/03/05 22:09:52, rsc wrote:
> > fine. another common idiom is to avoid the math:
> > 
> > picture[i], pixels = pixels[:XSize], pixels[XSize:]
> 
> @rcs - how does this "common idiom" work? It obfuscates what is happening
> probably because I'm a new go programmer - however, isn't that what these docs
> are for? Looking for ref to docs.

Never mind. It's a tuple assignment. I didn't see that - thought some magic was
happening.

http://stackoverflow.com/questions/40073773/how-does-this-common-idiom-actual...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b