+ {{ if $typeIsBool }}
+ {{ if $value }}
+ {{ printf "
%#v" $value | safeHTML }}
{{ else }}
- {{ printf "
| %s | %s |
" $type0 $value0 | safeHTML }}
+ {{ printf "
%#v" $value | safeHTML }}
{{ end }}
- {{ else if $type0IsString }}
- {{ printf "
| %s | %s |
" $type0 $value0 | safeHTML }}
- {{ else if $type0IsTime }}
-
- {{ if ne ($value0.Format "2006-01-02") "0001-01-01" }}
- {{ printf "
| %s | %s |
" $type0 $value0 | safeHTML }}
- {{ end }}
- {{ else if $type0IsArray }}
- {{ printf "
| %s | " $type0 | safeHTML }}
- {{ range $value0 }}
- {{ if $type0IsStringArray }}
+ {{ else if (or $typeIsString $typeIsTime) }}
+ {{ printf "%s" $value | safeHTML }}
+ {{ else if $typeIsArray }}
+ {{ range $value }}
+ {{ if $typeIsStringArray }}
- {{ printf "\"%s\"" . }}
- {{ else if $type0IsInterfaceArray }}
- {{ printf "%s" . }}
+ {{ printf "\"%s\"" . | safeHTML }}
+ {{ else if $typeIsInterfaceArray }}
+ {{ printf "%s" . | safeHTML }}
{{ else }}
- {{ printf "%#v" . }}
+ {{ printf "%#v" . | safeHTML }}
{{ end }}
{{ end }}
- {{ printf " |
" | safeHTML }}
- {{ else if $type0IsMap }}
-
| Key | Type | Value |
|---|
- {{ range $key1, $value1 := $value0 }}
- {{ $type1 := (printf "%T" $value1) }}
- {{ $type1IsBool := (eq "bool" $type1) }}
- {{ $type1IsString := (eq "string" $type1) }}
- {{ $type1IsTime := (eq "time.Time" $type1) }}
- {{ $type1IsArray := (findRE "^[[][]]" $type1 1 | len | eq 1) }}
- {{ $type1IsStringArray := (findRE "^[[][]]string" $type1 1 | len | eq 1) }}
- {{ $type1IsInterfaceArray := (findRE "^[[][]]interface" $type1 1 | len | eq 1) }}
- {{ $type1IsMap := (findRE "^map[[].+[]]" $type1 1 | len | eq 1) }}
-
- {{ if $type1IsBool }}
- {{ if $value1 }}
- {{ printf "
| %s | %s | %#v |
" $key1 $type1 $value1 | safeHTML }}
- {{ else }}
- {{ printf "
| %s | %s | %#v |
" $key1 $type1 $value1 | safeHTML }}
- {{ end }}
- {{ else if $type1IsString }}
- {{ printf "
| %s | %s | %s |
" $key1 $type1 $value1 | safeHTML }}
- {{ else if $type1IsTime }}
- {{ if ne ($value1.Format "2006-01-02") "0001-01-01" }}
- {{ printf "
| %s | %s | %s |
" $key1 $type1 $value1 | safeHTML }}
- {{ end }}
- {{ else if $type1IsArray }}
- {{ printf "
| %s | %s | " $key1 $type1 | safeHTML }}
- {{ range $value1 }}
- {{ if $type1IsStringArray }}
- {{ printf "\"%s\"" . }}
- {{ else if $type1IsInterfaceArray }}
- {{ printf "%s" . }}
- {{ else }}
- {{ printf "%#v" . }}
+ {{ else if $typeIsMap }}
+
+ | Key | Type | Value |
+ {{ range $key1, $value1 := $value }}
+ {{ $type1 := (printf "%T" $value1) }}
+ {{ $type1IsTime := (eq "time.Time" $type1) }}
+ {{ if $type1IsTime }}
+
+ {{ if (ne "0001-01-01" ($value1.Format "2006-01-02")) }}
+ {{ printf "| %s | %s | " $key1 $type1 | safeHTML }}
+ {{ partial "debugprint.html" $value1 }}
+ {{ printf " | " | safeHTML }}
{{ end }}
+ {{ else }}
+ {{ printf "| %s | %s | " $key1 $type1 | safeHTML }}
+ {{ partial "debugprint.html" $value1 }}
+ {{ printf " | " | safeHTML }}
{{ end }}
- {{ printf "" | safeHTML }}
- {{ else if $type1IsMap }}
- {{ printf "| %s | %s | " $key1 $type1 | safeHTML }}
-
- | Key | Type | Value |
- {{ range $key2, $value2 := $value1 }}
- {{ $type2 := (printf "%T" $value2) }}
- {{ $type2IsBool := (eq "bool" $type2) }}
- {{ $type2IsString := (eq "string" $type2) }}
- {{ $type2IsTime := (eq "time.Time" $type2) }}
- {{ $type2IsArray := (findRE "^[[][]]" $type2 1 | len | eq 1) }}
- {{ $type2IsStringArray := (findRE "^[[][]]string" $type2 1 | len | eq 1) }}
- {{ $type2IsInterfaceArray := (findRE "^[[][]]interface" $type2 1 | len | eq 1) }}
- {{ $type2IsMap := (findRE "^map[[].+[]]" $type2 1 | len | eq 1) }}
-
- {{ if $type2IsBool }}
- {{ if $value2 }}
- {{ printf "| %s | %s | %#v | " $key2 $type2 $value2 | safeHTML }}
- {{ else }}
- {{ printf "| %s | %s | %#v | " $key2 $type2 $value2 | safeHTML }}
- {{ end }}
- {{ else if $type2IsString }}
- {{ printf "| %s | %s | %s | " $key2 $type2 $value2 | safeHTML }}
- {{ else if $type2IsTime }}
- {{ if ne ($value2.Format "2006-01-02") "0001-01-01" }}
- {{ printf "| %s | %s | %s | " $key2 $type2 $value2 | safeHTML }}
- {{ end }}
- {{ else if $type2IsArray }}
- {{ printf "| %s | %s | " $key2 $type2 | safeHTML }}
- {{ range $value2 }}
- {{ if $type2IsStringArray }}
- {{ printf "\"%s\"" . }}
- {{ else if $type2IsInterfaceArray }}
- {{ printf "%s" . }}
- {{ else }}
- {{ printf "%#v" . }}
- {{ end }}
- {{ end }}
- {{ printf " | " | safeHTML }}
- {{ else }}
- {{ printf "| %s | %s | %#v | " $key2 $type2 $value2 | safeHTML }}
- {{ end }}
- {{ end }}
-
- {{ printf " | " | safeHTML }}
- {{ else }}
- {{ printf "| %s | %s | %#v | " $key1 $type1 $value1 | safeHTML }}
{{ end }}
- {{ end }}
+
+ {{ else }}
+ {{ printf "%#v" . | safeHTML }}
{{ end }}
-
- {{/* range $key1, $value1 := . */}}
- {{/* printf " |
| %#v | %#v |
" $key1 $value1 | safeHTML */}}
- {{/* end */}}
-