gofmt -s -w

This commit is contained in:
jim teeuwen 2011-12-07 13:49:06 +01:00
parent 470290002e
commit 7df69a98df
3 changed files with 9 additions and 10 deletions

View File

@ -14,19 +14,19 @@ type GoWriter struct {
c int c int
} }
func (this *GoWriter) Write(p []byte) (n int, err error) { func (w *GoWriter) Write(p []byte) (n int, err error) {
if len(p) == 0 { if len(p) == 0 {
return return
} }
for n = range p { for n = range p {
if this.c%12 == 0 { if w.c%12 == 0 {
this.Writer.Write([]byte{'\n'}) w.Writer.Write([]byte{'\n'})
this.c = 0 w.c = 0
} }
fmt.Fprintf(this.Writer, "0x%02x,", p[n]) fmt.Fprintf(w.Writer, "0x%02x,", p[n])
this.c++ w.c++
} }
return return

View File

@ -5,12 +5,12 @@
package main package main
import ( import (
"os"
"flag" "flag"
"fmt" "fmt"
"os"
"path" "path"
"strings"
"runtime" "runtime"
"strings"
"unicode" "unicode"
) )
@ -95,7 +95,6 @@ func main() {
if pipe { if pipe {
if err = translate(os.Stdin, os.Stdout, *pkgname, *funcname); err != nil { if err = translate(os.Stdin, os.Stdout, *pkgname, *funcname); err != nil {
fmt.Fprintf(os.Stderr, "[e] %s\n", err) fmt.Fprintf(os.Stderr, "[e] %s\n", err)
return
} }
} else { } else {
var fs, fd *os.File var fs, fd *os.File

View File

@ -1,9 +1,9 @@
package main package main
import ( import (
"io"
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"io"
) )
func gophercolor_png() ([]byte, error) { func gophercolor_png() ([]byte, error) {