Added --properties-array-brackets flag for properties encoder #1933

This commit is contained in:
Mike Farah
2024-02-20 11:39:56 +11:00
parent 2865022cf8
commit b24b484efc
7 changed files with 115 additions and 37 deletions
+7
View File
@@ -117,6 +117,13 @@ func (pe *propertiesEncoder) appendPath(path string, key interface{}) string {
if path == "" {
return fmt.Sprintf("%v", key)
}
switch key.(type) {
case int:
if pe.prefs.UseArrayBrackets {
return fmt.Sprintf("%v[%v]", path, key)
}
}
return fmt.Sprintf("%v.%v", path, key)
}