diff --git a/bytewriter.go b/bytewriter.go index c9b602c..ae9cbd3 100644 --- a/bytewriter.go +++ b/bytewriter.go @@ -9,7 +9,11 @@ import ( "io" ) -var newline = []byte{'\n'} +var ( + newline = []byte{'\n'} + dataindent = []byte{'\t', '\t'} + space = []byte{' '} +) type ByteWriter struct { io.Writer @@ -24,7 +28,10 @@ func (w *ByteWriter) Write(p []byte) (n int, err error) { for n = range p { if w.c%12 == 0 { w.Writer.Write(newline) + w.Writer.Write(dataindent) w.c = 0 + } else { + w.Writer.Write(space) } fmt.Fprintf(w.Writer, "0x%02x,", p[n])