The error is stored internally in *bio.Writer, more specifically
in *bufio.Writer and the current code does not handle it, ignoring
errors silently.
Change-Id: Iefa9bf7ddabb3c4fc03377e676a8098dcad9be6d
GitHub-Last-Rev:
a5d36223312773039c37bb1c52fffc96fff04fba
GitHub-Pull-Request: golang/go#71621
Reviewed-on: https://go-review.googlesource.com/c/go/+/647915
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
}
}
- b.Close()
+ if err := b.Close(); err != nil {
+ base.Fatalf("%v", err)
+ }
}
fmt.Printf("can't create %s: %v\n", outfile, err)
base.ErrorExit()
}
- defer bout.Close()
+
bout.WriteString("!<arch>\n")
if mode&modeCompilerObj != 0 {
dumpLinkerObj(bout)
finishArchiveEntry(bout, start, "_go_.o")
}
+
+ if err := bout.Close(); err != nil {
+ base.FlushErrors()
+ fmt.Printf("error while writing to file %s: %v\n", outfile, err)
+ base.ErrorExit()
+ }
}
func printObjHeader(bout *bio.Writer) {