mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-02 23:34:48 +08:00
Added --properties-array-brackets flag for properties encoder #1933
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user