aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encoding.go')
-rw-r--r--prog/encoding.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index af0bccfc0..b614e247e 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -56,6 +56,10 @@ type serializer struct {
verbose bool
}
+func (ctx *serializer) print(text string) {
+ ctx.printf("%v", text)
+}
+
func (ctx *serializer) printf(text string, args ...interface{}) {
fmt.Fprintf(ctx.buf, text, args...)
}
@@ -81,7 +85,7 @@ func (ctx *serializer) call(c *Call) {
}
ctx.arg(a)
}
- ctx.printf(")")
+ ctx.print(")")
anyChangedProps := false
c.Props.ForeachProp(func(name, key string, value reflect.Value) {
@@ -91,13 +95,13 @@ func (ctx *serializer) call(c *Call) {
}
if !anyChangedProps {
- ctx.printf(" (")
+ ctx.print(" (")
anyChangedProps = true
} else {
- ctx.printf(", ")
+ ctx.print(", ")
}
- ctx.printf(key)
+ ctx.print(key)
switch kind := value.Kind(); kind {
case reflect.Int:
ctx.printf(": %d", value.Int())