Fix for weekly.2012-02-14
This commit is contained in:
parent
02da4740e4
commit
ccc86c4533
|
@ -13,8 +13,6 @@ import (
|
||||||
// Translate the input file.
|
// Translate the input file.
|
||||||
// input -> gzip -> gowriter -> output.
|
// input -> gzip -> gowriter -> output.
|
||||||
func translate(input io.Reader, output io.Writer, pkgname, funcname string) (err error) {
|
func translate(input io.Reader, output io.Writer, pkgname, funcname string) (err error) {
|
||||||
var gz *gzip.Compressor
|
|
||||||
|
|
||||||
fmt.Fprintf(output, `package %s
|
fmt.Fprintf(output, `package %s
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -28,10 +26,7 @@ func %s() ([]byte, error) {
|
||||||
var err error
|
var err error
|
||||||
if gz, err = gzip.NewReader(bytes.NewBuffer([]byte{`, pkgname, funcname)
|
if gz, err = gzip.NewReader(bytes.NewBuffer([]byte{`, pkgname, funcname)
|
||||||
|
|
||||||
if gz, err = gzip.NewWriter(&GoWriter{Writer: output}); err != nil {
|
gz := gzip.NewWriter(&GoWriter{Writer: output})
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
io.Copy(gz, input)
|
io.Copy(gz, input)
|
||||||
gz.Close()
|
gz.Close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user