Commit eef79b67 authored by tengufromsky's avatar tengufromsky Committed by Brad Fitzpatrick

encoding/xml: remove unnecessary if conditions

Fixes gosimple warning "if err != nil { return err };
return nil' can be simplified to 'return err"

Change-Id: Ibbc717fb066ff41ab35c481b6d44980ac809ae09
Reviewed-on: https://go-review.googlesource.com/107018
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 49e3e436
...@@ -1932,10 +1932,8 @@ func escapeText(w io.Writer, s []byte, escapeNewline bool) error { ...@@ -1932,10 +1932,8 @@ func escapeText(w io.Writer, s []byte, escapeNewline bool) error {
} }
last = i last = i
} }
if _, err := w.Write(s[last:]); err != nil { _, err := w.Write(s[last:])
return err return err
}
return nil
} }
// EscapeString writes to p the properly escaped XML equivalent // EscapeString writes to p the properly escaped XML equivalent
...@@ -2018,10 +2016,8 @@ func emitCDATA(w io.Writer, s []byte) error { ...@@ -2018,10 +2016,8 @@ func emitCDATA(w io.Writer, s []byte) error {
} }
s = s[i:] s = s[i:]
} }
if _, err := w.Write(cdataEnd); err != nil { _, err := w.Write(cdataEnd)
return err return err
}
return nil
} }
// procInst parses the `param="..."` or `param='...'` // procInst parses the `param="..."` or `param='...'`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment