aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/sqlvm')
-rw-r--r--core/vm/sqlvm/ast/printer.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/vm/sqlvm/ast/printer.go b/core/vm/sqlvm/ast/printer.go
index 56cfd07b9..e9b289411 100644
--- a/core/vm/sqlvm/ast/printer.go
+++ b/core/vm/sqlvm/ast/printer.go
@@ -44,18 +44,17 @@ func printAST(w io.Writer, n interface{}, depth int, base string, detail bool) {
}
typeOf := reflect.TypeOf(n)
valueOf := reflect.ValueOf(n)
- name := ""
- if typeOf.Kind() == reflect.Ptr {
+ kind := typeOf.Kind()
+ if kind == reflect.Ptr {
if valueOf.IsNil() {
fmt.Fprintf(w, "%snil\n", indent)
return
}
- name = "*"
valueOf = valueOf.Elem()
typeOf = typeOf.Elem()
+ kind = typeOf.Kind()
}
- kind := typeOf.Kind()
- name = name + typeOf.Name()
+ name := typeOf.Name()
if op, ok := n.(UnaryOperator); ok {
fmt.Fprintf(w, "%s%s:\n", indent, name)