Add flags and options for future extensibility (fixes #1027)

This commit is contained in:
Jakob Borg
2015-03-25 21:21:41 +01:00
parent 0289c50ad9
commit 23bae932c7
4 changed files with 77 additions and 9 deletions
+11 -1
View File
@@ -263,6 +263,13 @@ func handleStruct(t *ast.StructType) []fieldInfo {
Max: max,
}
}
case *ast.SelectorExpr:
f = fieldInfo{
Name: fn,
FieldType: ft.Sel.Name,
Max: max,
}
}
fs = append(fs, f)
@@ -346,7 +353,10 @@ func generateDiagram(output io.Writer, s structInfo) {
fmt.Fprintf(output, "\\ %s \\\n", center(tn, 61))
fmt.Fprintf(output, "/ %s /\n", center("", 61))
} else {
fmt.Fprintf(output, "| %s |\n", center(tn, 61))
tn = tn + " Structure"
fmt.Fprintf(output, "/ %s /\n", center("", 61))
fmt.Fprintf(output, "\\ %s \\\n", center(tn, 61))
fmt.Fprintf(output, "/ %s /\n", center("", 61))
}
fmt.Fprintln(output, line)
}