Motif No. 1, copyright © 2010 Douglas Cuthbertson
Template Process Map
{{- define "processMap" -}}
{{- $row := . -}}
{{- range $k, $v := $row -}}
{{- if and (not (reflect.IsMap $v)) (not (reflect.IsSlice $v)) -}}
<td>{{- $k -}} (map->scalar): ({{$v}})</td>
{{- else if reflect.IsMap $v -}}
<tr class="body">{{- $k -}} (map-map): {{- template "processMap" $v -}}</tr>
{{- else if reflect.IsSlice $v}}
<tr class="body">{{- template "createRows" $v -}}</tr>
{{- else -}}
<td>{{$k}} (map-unknown): {{- $v -}}</td>
{{- end -}}
{{- end -}}
{{- end -}}