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
(387)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 7085053: code review 7085053: encoding/xml: make sure Encoder.Encode reports Write errors.

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 12 months ago by osaingre
Modified:
12 years, 5 months ago
Reviewers:
rsc
CC:
DMorsing, dave_cheney.net, rsc, golang-dev
Visibility:
Public.
encoding/xml: make sure Encoder.Encode reports Write errors. Fixes issue 4112.

Patch Set 1 #

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

Total comments: 6

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

Created: 12 years, 10 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -14 lines) Patch
M src/pkg/encoding/xml/marshal.go View 1 2 3 chunks +18 lines, -9 lines 0 comments Download
M src/pkg/encoding/xml/marshal_test.go View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M src/pkg/encoding/xml/xml.go View 1 2 chunks +19 lines, -5 lines 0 comments Download
M src/pkg/encoding/xml/xml_test.go View 1 1 chunk +14 lines, -0 lines 0 comments Download
Total messages: 15
|
osaingre
Hi, I'd like you to review that Go 1.1 issue fix. Thanks, Olivier
12 years, 12 months ago (2013年01月13日 21:22:19 UTC) #1
Hi,
I'd like you to review that Go 1.1 issue fix.
Thanks,
Olivier
Sign in to reply to this message.
remyoudompheng
Why don't I see this issue on http://gocodereview.appspot.com ? https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go File src/pkg/encoding/xml/marshal.go (right): https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go#newcode249 src/pkg/encoding/xml/marshal.go:249: ...
12 years, 11 months ago (2013年01月16日 21:34:13 UTC) #2
Why don't I see this issue on http://gocodereview.appspot.com ?
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go
File src/pkg/encoding/xml/marshal.go (right):
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:249: if err := EscapeText(p,
[]byte(val.String())); err != nil {
the printer is backed by a bufio.Writer and hence has sticky errors: any error
invalidates all future writes and should be returned by the p.cachedWriteError()
below.
Why doesn't it work?
Sign in to reply to this message.
DMorsing
On Wed, Jan 16, 2013 at 10:34 PM, <remyoudompheng@gmail.com> wrote: > Why don't I see ...
12 years, 11 months ago (2013年01月17日 09:01:55 UTC) #3
On Wed, Jan 16, 2013 at 10:34 PM, <remyoudompheng@gmail.com> wrote:
> Why don't I see this issue on http://gocodereview.appspot.com ?
>
I think gocodereview is mail based and golang-dev isn't on the CC list.
Sign in to reply to this message.
dave_cheney.net
Maybe this review was created by hand without the aide of hg mail On Thu, ...
12 years, 11 months ago (2013年01月17日 09:03:21 UTC) #4
Maybe this review was created by hand without the aide of hg mail
On Thu, Jan 17, 2013 at 8:01 PM, Daniel Morsing
<daniel.morsing@gmail.com> wrote:
> On Wed, Jan 16, 2013 at 10:34 PM, <remyoudompheng@gmail.com> wrote:
>> Why don't I see this issue on http://gocodereview.appspot.com ?
>>
>
> I think gocodereview is mail based and golang-dev isn't on the CC list.
Sign in to reply to this message.
osaingre
On 2013年01月17日 09:03:21, dfc wrote: > Maybe this review was created by hand without the ...
12 years, 11 months ago (2013年01月17日 21:41:47 UTC) #5
On 2013年01月17日 09:03:21, dfc wrote:
> Maybe this review was created by hand without the aide of hg mail
> 
> On Thu, Jan 17, 2013 at 8:01 PM, Daniel Morsing
> <mailto:daniel.morsing@gmail.com> wrote:
> > On Wed, Jan 16, 2013 at 10:34 PM, <mailto:remyoudompheng@gmail.com> wrote:
> >> Why don't I see this issue on http://gocodereview.appspot.com ?
> >>
> >
> > I think gocodereview is mail based and golang-dev isn't on the CC list.
In fact, I left the Reviewer and CC fields blanks (as specified in Contributing
Guidelines) when doing 'hg change'. But no notifications were sent to
golang-dev. So I edited the code review to add golang-dev and puslished+mailed.
Sign in to reply to this message.
rsc
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go File src/pkg/encoding/xml/marshal.go (right): https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go#newcode249 src/pkg/encoding/xml/marshal.go:249: if err := EscapeText(p, []byte(val.String())); err != nil { ...
12 years, 11 months ago (2013年01月18日 22:03:24 UTC) #6
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go
File src/pkg/encoding/xml/marshal.go (right):
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:249: if err := EscapeText(p,
[]byte(val.String())); err != nil {
On 2013年01月16日 21:34:13, remyoudompheng wrote:
> the printer is backed by a bufio.Writer and hence has sticky errors: any error
> invalidates all future writes and should be returned by the
p.cachedWriteError()
> below.
> 
> Why doesn't it work?
Agreed.
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:260: if err := EscapeText(p, bytes); err != nil
{
While you are here, make this val.Slice(0, val.Len()).Bytes() and delete the
three lines above.
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:293: return err
This might be worth keeping because it exits the loop early.
Sign in to reply to this message.
osaingre
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go File src/pkg/encoding/xml/marshal.go (right): https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go#newcode260 src/pkg/encoding/xml/marshal.go:260: if err := EscapeText(p, bytes); err != nil { ...
12 years, 11 months ago (2013年02月04日 22:29:04 UTC) #7
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go
File src/pkg/encoding/xml/marshal.go (right):
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:260: if err := EscapeText(p, bytes); err != nil
{
On 2013年01月18日 22:03:24, rsc wrote:
> While you are here, make this val.Slice(0, val.Len()).Bytes() and delete the
> three lines above.
If I do that, it'll panic on arrays because of the reflect.ValueOf upstream, in
Encode().
Sign in to reply to this message.
rsc
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go File src/pkg/encoding/xml/marshal.go (right): https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go#newcode260 src/pkg/encoding/xml/marshal.go:260: if err := EscapeText(p, bytes); err != nil { ...
12 years, 11 months ago (2013年02月08日 20:12:12 UTC) #8
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal.go
File src/pkg/encoding/xml/marshal.go (right):
https://codereview.appspot.com/7085053/diff/1001/src/pkg/encoding/xml/marshal...
src/pkg/encoding/xml/marshal.go:260: if err := EscapeText(p, bytes); err != nil
{
Not sure I understand. At the least, you can do
var bytes []bytes
if val.CanAddr() {
 bytes = val.Slice(0, val.Len())
} else {
 bytes = make([]byte, val.Len())
 reflect.Copy(reflect.ValueOf(bytes), val)
}
Sign in to reply to this message.
osaingre
Hello remyoudompheng@gmail.com, daniel.morsing@gmail.com, dave@cheney.net, rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
12 years, 10 months ago (2013年02月18日 22:32:02 UTC) #9
rsc
LGTM
12 years, 10 months ago (2013年02月19日 15:44:36 UTC) #10
LGTM
Sign in to reply to this message.
rsc
Please complete a CLA as described at golang.org/doc/contribute.html#copyright. Thanks. Russ
12 years, 10 months ago (2013年02月19日 15:48:50 UTC) #11
Please complete a CLA as described at
golang.org/doc/contribute.html#copyright.
Thanks.
Russ
Sign in to reply to this message.
osaingre
On 2013年02月19日 15:48:50, rsc wrote: > Please complete a CLA as described at > golang.org/doc/contribute.html#copyright. ...
12 years, 10 months ago (2013年02月20日 08:33:54 UTC) #12
On 2013年02月19日 15:48:50, rsc wrote:
> Please complete a CLA as described at
> golang.org/doc/contribute.html#copyright.
> 
> Thanks.
> Russ
Cool, thanks.
I agreed and submitted yesterday. Though I got no confirmation.
Sign in to reply to this message.
dave_cheney.net
Yeah, there is no visible confirmation. Once the paperwork is done on the Google side ...
12 years, 10 months ago (2013年02月20日 08:40:50 UTC) #13
Yeah, there is no visible confirmation. Once the paperwork is done on
the Google side a committer will propose a change which adds your
details to CONTRIBUTORS and AUTHORS.
On Wed, Feb 20, 2013 at 7:33 PM, <osaingre@gmail.com> wrote:
> On 2013年02月19日 15:48:50, rsc wrote:
>>
>> Please complete a CLA as described at
>> golang.org/doc/contribute.html#copyright.
>
>
>> Thanks.
>> Russ
>
> Cool, thanks.
> I agreed and submitted yesterday. Though I got no confirmation.
>
>
> https://codereview.appspot.com/7085053/
Sign in to reply to this message.
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=ccecfdaf3719 *** encoding/xml: make sure Encoder.Encode reports Write errors. Fixes issue 4112. ...
12 years, 10 months ago (2013年02月20日 22:41:25 UTC) #14
*** Submitted as https://code.google.com/p/go/source/detail?r=ccecfdaf3719 ***
encoding/xml: make sure Encoder.Encode reports Write errors.
Fixes issue 4112.
R=remyoudompheng, daniel.morsing, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7085053
Committer: Brad Fitzpatrick <bradfitz@golang.org>
Sign in to reply to this message.
remyoudompheng
R=close
12 years, 5 months ago (2013年07月20日 21:33:17 UTC) #15
R=close
Sign in to reply to this message.
|
This is Rietveld f62528b

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