From 0a432b9aef0d6d60c849963ff2236b16ba033cb0 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 8 Jul 2022 12:18:55 +0200 Subject: [PATCH] fix adoc for slices Signed-off-by: Christian Richter --- docs/helpers/adoc-generator.go.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/helpers/adoc-generator.go.tmpl b/docs/helpers/adoc-generator.go.tmpl index d091b0477..f8ff5701d 100644 --- a/docs/helpers/adoc-generator.go.tmpl +++ b/docs/helpers/adoc-generator.go.tmpl @@ -95,7 +95,11 @@ func GetAnnotatedVariables(s interface{}) []ConfigField { desc = re.ReplaceAllString(desc, "\\$1") re = regexp.MustCompile(`(\|)`) v = re.ReplaceAllString(v, "\\$1") - fields = append(fields, ConfigField{EnvVars: td, DefaultValue: v, Description: desc, Type: value.Type().Name()}) + typeName := value.Type().Name() + if typeName == "" { + typeName = value.Type().String() + } + fields = append(fields, ConfigField{EnvVars: td, DefaultValue: v, Description: desc, Type: typeName}) case reflect.Ptr: // PolicySelectors in the Proxy are being skipped atm // they are not configurable via env vars, if that changes