Commit d307bd4e authored by Leon Klingele's avatar Leon Klingele Committed by Benny Siegert

encoding/gob: properly ignore errors

Change-Id: I8827cef0f57459384329c50c51795350da0ede4b
GitHub-Last-Rev: c9ad9e12b5a0fff47c21a8c299b762b64b8c9c7c
GitHub-Pull-Request: golang/go#30010
Reviewed-on: https://go-review.googlesource.com/c/go/+/160434
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent 983986f2
......@@ -185,10 +185,12 @@ func main() {
log.Fatal("source format error:", err)
}
fd, err := os.Create(*output)
_, err = fd.Write(source)
if err != nil {
log.Fatal(err)
}
if _, err := fd.Write(source); err != nil {
log.Fatal(err)
}
}
func printMaps(b *bytes.Buffer, upperClass string) {
......
......@@ -164,10 +164,12 @@ func main() {
log.Fatal("source format error:", err)
}
fd, err := os.Create(*output)
_, err = fd.Write(source)
if err != nil {
log.Fatal(err)
}
if _, err := fd.Write(source); err != nil {
log.Fatal(err)
}
}
func printMaps(b *bytes.Buffer, upperClass string) {
......
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