printer: use tabwriter to align instructions (#8)
This commit is contained in:
@@ -4,6 +4,7 @@ package prnt
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
// Generator provides convenience methods for code generators. In particular it
|
||||
@@ -15,6 +16,11 @@ type Generator struct {
|
||||
err error
|
||||
}
|
||||
|
||||
// Raw provides direct access to the underlying output stream.
|
||||
func (g *Generator) Raw() io.Writer {
|
||||
return &g.buf
|
||||
}
|
||||
|
||||
// Printf prints to the internal buffer.
|
||||
func (g *Generator) Printf(format string, args ...interface{}) {
|
||||
if g.err != nil {
|
||||
|
||||
Reference in New Issue
Block a user