Skip to content

Commit 322e202

Browse files
authored
change marshal function to add indentation (#323)
1 parent df56911 commit 322e202

File tree

115 files changed

+116
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+116
-116
lines changed

internal/cmd/argus/credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []argus.Ser
134134

135135
return nil
136136
case print.YAMLOutputFormat:
137-
details, err := yaml.Marshal(credentials)
137+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
138138
if err != nil {
139139
return fmt.Errorf("marshal Argus credentials list: %w", err)
140140
}

internal/cmd/argus/grafana/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func outputResult(p *print.Printer, inputModel *inputModel, grafanaConfigs *argu
135135

136136
return nil
137137
case print.YAMLOutputFormat:
138-
details, err := yaml.Marshal(grafanaConfigs)
138+
details, err := yaml.MarshalWithOptions(grafanaConfigs, yaml.IndentSequence(true))
139139
if err != nil {
140140
return fmt.Errorf("marshal Grafana configs: %w", err)
141141
}

internal/cmd/argus/instance/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
210210

211211
return nil
212212
case print.YAMLOutputFormat:
213-
details, err := yaml.Marshal(resp)
213+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
214214
if err != nil {
215215
return fmt.Errorf("marshal Argus instance: %w", err)
216216
}

internal/cmd/argus/instance/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *argus.GetInst
108108

109109
return nil
110110
case print.YAMLOutputFormat:
111-
details, err := yaml.Marshal(instance)
111+
details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true))
112112
if err != nil {
113113
return fmt.Errorf("marshal Argus instance: %w", err)
114114
}

internal/cmd/argus/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []argus.Proje
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(instances)
143+
details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal Argus instance list: %w", err)
146146
}

internal/cmd/argus/plans/plans.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []argus.Plan) err
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(plans)
143+
details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal Argus plans: %w", err)
146146
}

internal/cmd/argus/scrape-config/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, config *argus.Job) erro
110110

111111
return nil
112112
case print.YAMLOutputFormat:
113-
details, err := yaml.Marshal(config)
113+
details, err := yaml.MarshalWithOptions(config, yaml.IndentSequence(true))
114114
if err != nil {
115115
return fmt.Errorf("marshal scrape configuration: %w", err)
116116
}

internal/cmd/argus/scrape-config/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func outputResult(p *print.Printer, outputFormat string, configs []argus.Job) er
137137

138138
return nil
139139
case print.YAMLOutputFormat:
140-
details, err := yaml.Marshal(configs)
140+
details, err := yaml.MarshalWithOptions(configs, yaml.IndentSequence(true))
141141
if err != nil {
142142
return fmt.Errorf("marshal scrape configurations list: %w", err)
143143
}

internal/cmd/config/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func outputResult(p *print.Printer, outputFormat string, configData map[string]a
7575
p.Outputln(string(details))
7676
return nil
7777
case print.YAMLOutputFormat:
78-
details, err := yaml.Marshal(configData)
78+
details, err := yaml.MarshalWithOptions(configData, yaml.IndentSequence(true))
7979
if err != nil {
8080
return fmt.Errorf("marshal config list: %w", err)
8181
}

internal/cmd/dns/record-set/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func outputResult(p *print.Printer, model *inputModel, zoneLabel string, resp *d
177177

178178
return nil
179179
case print.YAMLOutputFormat:
180-
details, err := yaml.Marshal(resp)
180+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
181181
if err != nil {
182182
return fmt.Errorf("marshal DNS record-set: %w", err)
183183
}

internal/cmd/dns/record-set/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func outputResult(p *print.Printer, outputFormat string, recordSet *dns.RecordSe
124124

125125
return nil
126126
case print.YAMLOutputFormat:
127-
details, err := yaml.Marshal(recordSet)
127+
details, err := yaml.MarshalWithOptions(recordSet, yaml.IndentSequence(true))
128128
if err != nil {
129129
return fmt.Errorf("marshal DNS record set: %w", err)
130130
}

internal/cmd/dns/record-set/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func outputResult(p *print.Printer, outputFormat string, recordSets []dns.Record
245245

246246
return nil
247247
case print.YAMLOutputFormat:
248-
details, err := yaml.Marshal(recordSets)
248+
details, err := yaml.MarshalWithOptions(recordSets, yaml.IndentSequence(true))
249249
if err != nil {
250250
return fmt.Errorf("marshal DNS record set list: %w", err)
251251
}

internal/cmd/dns/zone/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
206206

207207
return nil
208208
case print.YAMLOutputFormat:
209-
details, err := yaml.Marshal(resp)
209+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
210210
if err != nil {
211211
return fmt.Errorf("marshal DNS zone: %w", err)
212212
}

internal/cmd/dns/zone/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func outputResult(p *print.Printer, outputFormat string, zone *dns.Zone) error {
109109

110110
return nil
111111
case print.YAMLOutputFormat:
112-
details, err := yaml.Marshal(zone)
112+
details, err := yaml.MarshalWithOptions(zone, yaml.IndentSequence(true))
113113
if err != nil {
114114
return fmt.Errorf("marshal DNS zone: %w", err)
115115
}

internal/cmd/dns/zone/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func outputResult(p *print.Printer, outputFormat string, zones []dns.Zone) error
234234

235235
return nil
236236
case print.YAMLOutputFormat:
237-
details, err := yaml.Marshal(zones)
237+
details, err := yaml.MarshalWithOptions(zones, yaml.IndentSequence(true))
238238
if err != nil {
239239
return fmt.Errorf("marshal DNS zone list: %w", err)
240240
}

internal/cmd/load-balancer/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancer *loadbalan
108108

109109
return nil
110110
case print.YAMLOutputFormat:
111-
details, err := yaml.Marshal(loadBalancer)
111+
details, err := yaml.MarshalWithOptions(loadBalancer, yaml.IndentSequence(true))
112112
if err != nil {
113113
return fmt.Errorf("marshal load balancer: %w", err)
114114
}

internal/cmd/load-balancer/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancers []loadbal
141141

142142
return nil
143143
case print.YAMLOutputFormat:
144-
details, err := yaml.Marshal(loadBalancers)
144+
details, err := yaml.MarshalWithOptions(loadBalancers, yaml.IndentSequence(true))
145145
if err != nil {
146146
return fmt.Errorf("marshal load balancer list: %w", err)
147147
}

internal/cmd/load-balancer/observability-credentials/add/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
159159

160160
return nil
161161
case print.YAMLOutputFormat:
162-
details, err := yaml.Marshal(resp)
162+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
163163
if err != nil {
164164
return fmt.Errorf("marshal Load Balancer observability credentials: %w", err)
165165
}

internal/cmd/load-balancer/observability-credentials/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *loadbalanc
105105

106106
return nil
107107
case print.YAMLOutputFormat:
108-
details, err := yaml.Marshal(credentials)
108+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
109109
if err != nil {
110110
return fmt.Errorf("marshal Load Balancer observability credentials: %w", err)
111111
}

internal/cmd/load-balancer/observability-credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []loadbalan
177177

178178
return nil
179179
case print.YAMLOutputFormat:
180-
details, err := yaml.Marshal(credentials)
180+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
181181
if err != nil {
182182
return fmt.Errorf("marshal Load Balancer observability credentials list: %w", err)
183183
}

internal/cmd/load-balancer/quota/quota.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func outputResult(p *print.Printer, outputFormat string, quota *loadbalancer.Get
9898

9999
return nil
100100
case print.YAMLOutputFormat:
101-
details, err := yaml.Marshal(quota)
101+
details, err := yaml.MarshalWithOptions(quota, yaml.IndentSequence(true))
102102
if err != nil {
103103
return fmt.Errorf("marshal quota: %w", err)
104104
}

internal/cmd/load-balancer/target-pool/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func outputResult(p *print.Printer, outputFormat string, targetPool loadbalancer
138138

139139
return nil
140140
case print.YAMLOutputFormat:
141-
details, err := yaml.Marshal(output)
141+
details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true))
142142
if err != nil {
143143
return fmt.Errorf("marshal load balancer: %w", err)
144144
}

internal/cmd/logme/credentials/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res
136136

137137
return nil
138138
case print.YAMLOutputFormat:
139-
details, err := yaml.Marshal(resp)
139+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
140140
if err != nil {
141141
return fmt.Errorf("marshal LogMe credentials: %w", err)
142142
}

internal/cmd/logme/credentials/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *logme.Cred
122122

123123
return nil
124124
case print.YAMLOutputFormat:
125-
details, err := yaml.Marshal(credentials)
125+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
126126
if err != nil {
127127
return fmt.Errorf("marshal LogMe credentials: %w", err)
128128
}

internal/cmd/logme/credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []logme.Cre
145145

146146
return nil
147147
case print.YAMLOutputFormat:
148-
details, err := yaml.Marshal(credentials)
148+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
149149
if err != nil {
150150
return fmt.Errorf("marshal LogMe credentials list: %w", err)
151151
}

internal/cmd/logme/instance/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
262262

263263
return nil
264264
case print.YAMLOutputFormat:
265-
details, err := yaml.Marshal(resp)
265+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
266266
if err != nil {
267267
return fmt.Errorf("marshal LogMe instance: %w", err)
268268
}

internal/cmd/logme/instance/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *logme.Instanc
110110

111111
return nil
112112
case print.YAMLOutputFormat:
113-
details, err := yaml.Marshal(instance)
113+
details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true))
114114
if err != nil {
115115
return fmt.Errorf("marshal LogMe instance: %w", err)
116116
}

internal/cmd/logme/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []logme.Insta
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(instances)
143+
details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal LogMe instance list: %w", err)
146146
}

internal/cmd/logme/plans/plans.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []logme.Offering)
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(plans)
143+
details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal LogMe plans: %w", err)
146146
}

internal/cmd/mariadb/credentials/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res
137137

138138
return nil
139139
case print.YAMLOutputFormat:
140-
details, err := yaml.Marshal(resp)
140+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
141141
if err != nil {
142142
return fmt.Errorf("marshal Argus credentials list: %w", err)
143143
}

internal/cmd/mariadb/credentials/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *mariadb.Cr
122122

123123
return nil
124124
case print.YAMLOutputFormat:
125-
details, err := yaml.Marshal(credentials)
125+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
126126
if err != nil {
127127
return fmt.Errorf("marshal MariaDB credentials: %w", err)
128128
}

internal/cmd/mariadb/credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []mariadb.C
145145

146146
return nil
147147
case print.YAMLOutputFormat:
148-
details, err := yaml.Marshal(credentials)
148+
details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true))
149149
if err != nil {
150150
return fmt.Errorf("marshal MariaDB credentials list: %w", err)
151151
}

internal/cmd/mariadb/instance/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
262262

263263
return nil
264264
case print.YAMLOutputFormat:
265-
details, err := yaml.Marshal(resp)
265+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
266266
if err != nil {
267267
return fmt.Errorf("marshal MariaDB instance: %w", err)
268268
}

internal/cmd/mariadb/instance/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mariadb.Insta
110110

111111
return nil
112112
case print.YAMLOutputFormat:
113-
details, err := yaml.Marshal(instance)
113+
details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true))
114114
if err != nil {
115115
return fmt.Errorf("marshal MariaDB instance: %w", err)
116116
}

internal/cmd/mariadb/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []mariadb.Ins
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(instances)
143+
details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal MariaDB instance list: %w", err)
146146
}

internal/cmd/mariadb/plans/plans.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []mariadb.Offerin
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(plans)
143+
details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal MariaDB plans: %w", err)
146146
}

internal/cmd/mongodbflex/backup/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat, restoreSta
136136

137137
return nil
138138
case print.YAMLOutputFormat:
139-
details, err := yaml.Marshal(backup)
139+
details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true))
140140
if err != nil {
141141
return fmt.Errorf("marshal MongoDB Flex backup: %w", err)
142142
}

internal/cmd/mongodbflex/backup/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func outputResult(p *print.Printer, outputFormat string, backups []mongodbflex.B
155155

156156
return nil
157157
case print.YAMLOutputFormat:
158-
details, err := yaml.Marshal(backups)
158+
details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true))
159159
if err != nil {
160160
return fmt.Errorf("marshal MongoDB Flex backups list: %w", err)
161161
}

internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func outputResult(p *print.Printer, outputFormat string, restoreJobs []mongodbfl
149149

150150
return nil
151151
case print.YAMLOutputFormat:
152-
details, err := yaml.Marshal(restoreJobs)
152+
details, err := yaml.MarshalWithOptions(restoreJobs, yaml.IndentSequence(true))
153153
if err != nil {
154154
return fmt.Errorf("marshal MongoDB Flex restore jobs list: %w", err)
155155
}

internal/cmd/mongodbflex/backup/schedule/schedule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mongodbflex.I
130130

131131
return nil
132132
case print.YAMLOutputFormat:
133-
details, err := yaml.Marshal(output)
133+
details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true))
134134
if err != nil {
135135
return fmt.Errorf("marshal MongoDB Flex backup schedule: %w", err)
136136
}

internal/cmd/mongodbflex/instance/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp
284284

285285
return nil
286286
case print.YAMLOutputFormat:
287-
details, err := yaml.Marshal(resp)
287+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
288288
if err != nil {
289289
return fmt.Errorf("marshal MongoDBFlex instance: %w", err)
290290
}

internal/cmd/mongodbflex/instance/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mongodbflex.I
110110

111111
return nil
112112
case print.YAMLOutputFormat:
113-
details, err := yaml.Marshal(instance)
113+
details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true))
114114
if err != nil {
115115
return fmt.Errorf("marshal MongoDB Flex instance: %w", err)
116116
}

internal/cmd/mongodbflex/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []mongodbflex
140140

141141
return nil
142142
case print.YAMLOutputFormat:
143-
details, err := yaml.Marshal(instances)
143+
details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true))
144144
if err != nil {
145145
return fmt.Errorf("marshal MongoDB Flex instance list: %w", err)
146146
}

internal/cmd/mongodbflex/instance/update/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res
318318

319319
return nil
320320
case print.YAMLOutputFormat:
321-
details, err := yaml.Marshal(resp)
321+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
322322
if err != nil {
323323
return fmt.Errorf("marshal update MongoDBFlex instance: %w", err)
324324
}

0 commit comments

Comments
 (0)