mirror of
https://github.com/golang/go
synced 2024-11-18 11:44:45 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
49e3e436e7
commit
eef79b6712
@ -1932,10 +1932,8 @@ func escapeText(w io.Writer, s []byte, escapeNewline bool) error {
|
||||
}
|
||||
last = i
|
||||
}
|
||||
if _, err := w.Write(s[last:]); err != nil {
|
||||
_, err := w.Write(s[last:])
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EscapeString writes to p the properly escaped XML equivalent
|
||||
@ -2018,10 +2016,8 @@ func emitCDATA(w io.Writer, s []byte) error {
|
||||
}
|
||||
s = s[i:]
|
||||
}
|
||||
if _, err := w.Write(cdataEnd); err != nil {
|
||||
_, err := w.Write(cdataEnd)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// procInst parses the `param="..."` or `param='...'`
|
||||
|
Loading…
Reference in New Issue
Block a user