gofmt -s -w
This commit is contained in:
parent
470290002e
commit
7df69a98df
12
gowriter.go
12
gowriter.go
|
@ -14,19 +14,19 @@ type GoWriter struct {
|
|||
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 {
|
||||
return
|
||||
}
|
||||
|
||||
for n = range p {
|
||||
if this.c%12 == 0 {
|
||||
this.Writer.Write([]byte{'\n'})
|
||||
this.c = 0
|
||||
if w.c%12 == 0 {
|
||||
w.Writer.Write([]byte{'\n'})
|
||||
w.c = 0
|
||||
}
|
||||
|
||||
fmt.Fprintf(this.Writer, "0x%02x,", p[n])
|
||||
this.c++
|
||||
fmt.Fprintf(w.Writer, "0x%02x,", p[n])
|
||||
w.c++
|
||||
}
|
||||
|
||||
return
|
||||
|
|
5
main.go
5
main.go
|
@ -5,12 +5,12 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"runtime"
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
|
@ -95,7 +95,6 @@ func main() {
|
|||
if pipe {
|
||||
if err = translate(os.Stdin, os.Stdout, *pkgname, *funcname); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[e] %s\n", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
var fs, fd *os.File
|
||||
|
|
2
testdata/gophercolor.png.go
vendored
2
testdata/gophercolor.png.go
vendored
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
)
|
||||
|
||||
func gophercolor_png() ([]byte, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user