Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(322)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 161067: code review 161067: Derefer interfaces when looping in templates

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 1 month ago by sven
Modified:
2 years, 2 months ago
Reviewers:
CC:
rsc
Visibility:
Public.
Derefer interfaces when looping in templates

Patch Set 1 : code review 161067: Derefer interfaces when looping in templates #

Created: 16 years, 1 month ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -0 lines) Patch
M src/pkg/template/template.go View 1 chunk +4 lines, -0 lines 0 comments Download
Total messages: 4
|
sven
Hello rsc (cc: sven), I'd like you to review the following change.
16 years, 1 month ago (2009年11月28日 19:18:26 UTC) #1
Hello rsc (cc: sven),
I'd like you to review the following change.
Sign in to reply to this message.
rsc
Thanks. Could you please fill out the CLA as described at http://golang.org/doc/contribute.html#copyright and let me ...
16 years, 1 month ago (2009年11月29日 23:21:20 UTC) #2
Thanks. Could you please fill out the CLA as
described at http://golang.org/doc/contribute.html#copyright
and let me know once you have. There's no need
to create a separate AUTHORS/CONTRIBUTORS CL -
we'll take care of that - just let me know once you've
filled out the form.
For this change, it's maybe overkill, but people who
send small changes typically end up being people
who send more substantial changes later, and this
will get that out of the way.
Thanks.
On Sat, Nov 28, 2009 at 11:18, <sven@tras.se> wrote:
> Reviewers: rsc,
>
> Message:
> Hello rsc (cc: sven),
>
> I'd like you to review the following change.
>
>
> Description:
> Derefer interfaces when looping in templates
>
> Please review this at http://codereview.appspot.com/161067
>
> Affected files:
> M src/pkg/template/template.go
>
>
> Index: src/pkg/template/template.go
> ===================================================================
> --- a/src/pkg/template/template.go
> +++ b/src/pkg/template/template.go
> @@ -774,6 +774,10 @@
>    }
>    first := true;
>
> +    if iface, ok := field.(*reflect.InterfaceValue); ok {
> +        field = iface.Elem()
> +    }
> +
>    if array, ok := field.(reflect.ArrayOrSliceValue); ok {
>        for j := 0; j < array.Len(); j++ {
>            newst := st.clone(array.Elem(j));
>
>
>
Sign in to reply to this message.
rsc
This looks great. Could you please add a test in template_test.go to make sure that ...
16 years, 1 month ago (2009年12月01日 20:10:27 UTC) #3
This looks great. Could you please add a test
in template_test.go to make sure that the code
works and, more importantly, to make sure that
we don't break it in the future?
After changing template_test.go:
 cd $GOROOT/src/pkg/template
 hg file 161067 template_test.go
 hg mail 161067
Thanks.
Russ
Sign in to reply to this message.
rsc
Added functionality in a different way.
15 years, 12 months ago (2010年01月15日 21:52:56 UTC) #4
Added functionality in a different way.
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /