Fix output for generated file.

This commit is contained in:
jim teeuwen 2012-03-06 19:30:35 +01:00
parent ccc86c4533
commit fea0fad8ad
2 changed files with 8 additions and 8 deletions

View File

@ -22,16 +22,16 @@ import (
)
func %s() ([]byte, error) {
var gz *gzip.Decompressor
var err error
if gz, err = gzip.NewReader(bytes.NewBuffer([]byte{`, pkgname, funcname)
gz, err := gzip.NewReader(bytes.NewBuffer([]byte{`, pkgname, funcname)
gz := gzip.NewWriter(&GoWriter{Writer: output})
io.Copy(gz, input)
gz.Close()
fmt.Fprint(output, `
})); err != nil {
}))
if err != nil {
return nil, err
}

View File

@ -7,9 +7,7 @@ import (
)
func gophercolor_png() ([]byte, error) {
var gz *gzip.Decompressor
var err error
if gz, err = gzip.NewReader(bytes.NewBuffer([]byte{
gz, err := gzip.NewReader(bytes.NewBuffer([]byte{
0x1f,0x8b,0x08,0x00,0x00,0x09,0x6e,0x88,0x00,0xff,0x34,0x9b,
0x65,0x50,0x1b,0x5f,0x17,0xc6,0x43,0x69,0x8b,0xbb,0xbb,0xbb,
0x16,0x2d,0x5e,0xb4,0xb8,0xbb,0x16,0x77,0x77,0xa7,0xb8,0x14,
@ -1836,7 +1834,9 @@ func gophercolor_png() ([]byte, error) {
0x31,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,
0x82,0x01,0x00,0x00,0xff,0xff,0x25,0x50,0x56,0x5e,0x8b,0x55,
0x00,0x00,
})); err != nil {
}))
if err != nil {
return nil, err
}