mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd: remove bio.BufReader and bio.BufWriter
bio.BufReader was never used. bio.BufWriter was used to wrap an existing io.Writer, but the bio.Writer returned would not be seekable, so replace all occurences with bufio.Reader instead. Change-Id: I9c6779e35c63178aa4e104c17bb5bb8b52de0359 Reviewed-on: https://go-review.googlesource.com/21722 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6fee4aa5c7
commit
ca397bb68e
11 changed files with 28 additions and 40 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
|
|
@ -32,11 +33,6 @@ func main() {
|
|||
|
||||
flags.Parse()
|
||||
|
||||
// Create object file, write header.
|
||||
fd, err := os.Create(*flags.OutputFile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ctxt := obj.Linknew(architecture.LinkArch)
|
||||
if *flags.PrintOut {
|
||||
ctxt.Debugasm = 1
|
||||
|
|
@ -46,9 +42,14 @@ func main() {
|
|||
if *flags.Shared || *flags.Dynlink {
|
||||
ctxt.Flag_shared = 1
|
||||
}
|
||||
ctxt.Bso = bio.BufWriter(os.Stdout)
|
||||
ctxt.Bso = bufio.NewWriter(os.Stdout)
|
||||
defer ctxt.Bso.Flush()
|
||||
output := bio.BufWriter(fd)
|
||||
|
||||
// Create object file, write header.
|
||||
output, err := bio.Create(*flags.OutputFile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Fprintf(output, "go object %s %s %s\n", obj.Getgoos(), obj.Getgoarch(), obj.Getgoversion())
|
||||
fmt.Fprintf(output, "!\n")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue