diff --git a/bindata.go b/bindata.go index d6e1cdb..0a69a9d 100644 --- a/bindata.go +++ b/bindata.go @@ -15,7 +15,7 @@ import ( // If gofmt exists on the system, run it over the target file to // fix up the generated code. This is not necessary, just a convenience. -func gofmt(file string) (err os.Error) { +func gofmt(file string) (err error) { var prog string if prog = os.Getenv("GOBIN"); len(prog) == 0 { return @@ -28,7 +28,7 @@ func gofmt(file string) (err os.Error) { // Translate the input file. // input -> gzip -> gowriter -> output. -func translate(input io.Reader, output io.Writer, pkgname, funcname string) (err os.Error) { +func translate(input io.Reader, output io.Writer, pkgname, funcname string) (err error) { var gz *gzip.Compressor fmt.Fprintf(output, `package %s diff --git a/gowriter.go b/gowriter.go index eeb8f8c..0898683 100644 --- a/gowriter.go +++ b/gowriter.go @@ -7,7 +7,6 @@ package main import ( "fmt" "io" - "os" ) type GoWriter struct { @@ -15,7 +14,7 @@ type GoWriter struct { c int } -func (this *GoWriter) Write(p []byte) (n int, err os.Error) { +func (this *GoWriter) Write(p []byte) (n int, err error) { if len(p) == 0 { return } diff --git a/main.go b/main.go index 3cbd809..ff84ce2 100644 --- a/main.go +++ b/main.go @@ -91,7 +91,7 @@ func main() { // Read the input file, transform it into a gzip compressed data stream and // write it out as a go source file. - var err os.Error + var err error if pipe { if err = translate(os.Stdin, os.Stdout, *pkgname, *funcname); err != nil { fmt.Fprintf(os.Stderr, "[e] %s\n", err) @@ -104,14 +104,14 @@ func main() { fmt.Fprintf(os.Stderr, "[e] %s\n", err) return } - + defer fs.Close() if fd, err = os.Create(*out); err != nil { fmt.Fprintf(os.Stderr, "[e] %s\n", err) return } - + defer fd.Close() if err = translate(fs, fd, *pkgname, *funcname); err != nil { diff --git a/testdata/gophercolor.png.go b/testdata/gophercolor.png.go index fdf76eb..21316f6 100644 --- a/testdata/gophercolor.png.go +++ b/testdata/gophercolor.png.go @@ -2,14 +2,13 @@ package main import ( "io" - "os" "bytes" "compress/gzip" ) -func gophercolor_png() ([]byte, os.Error) { +func gophercolor_png() ([]byte, error) { var gz *gzip.Decompressor - var err os.Error + var err error if gz, err = gzip.NewReader(bytes.NewBuffer([]byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x34, 0x9b, 0x65, 0x50, 0x1b, 0x5f, 0x17, 0xc6, 0x43, 0x69, 0x8b, 0xbb, 0xbb, 0xbb,