Skip to content

Commit 8479ad9

Browse files
authored
Add yaml.UseJSONMarshaler() to all yaml.MarshalWithOptions()` calls (#595)
1 parent 7e094aa commit 8479ad9

File tree

204 files changed

+206
-206
lines changed

Some content is hidden

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

204 files changed

+206
-206
lines changed

internal/cmd/beta/image/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *iaas.ImageCreateRes
387387

388388
return nil
389389
case print.YAMLOutputFormat:
390-
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true))
390+
details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
391391
if err != nil {
392392
return fmt.Errorf("marshal image: %w", err)
393393
}

internal/cmd/beta/image/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, items []iaas.Image) err
145145

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

internal/cmd/beta/key-pair/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func outputResult(p *print.Printer, outputFormat string, item *iaas.Keypair) err
154154
}
155155
p.Outputln(string(details))
156156
case print.YAMLOutputFormat:
157-
details, err := yaml.MarshalWithOptions(item, yaml.IndentSequence(true))
157+
details, err := yaml.MarshalWithOptions(item, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
158158
if err != nil {
159159
return fmt.Errorf("marshal key pair: %w", err)
160160
}

internal/cmd/beta/key-pair/describe/describe.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ func outputResult(p *print.Printer, outputFormat string, showOnlyPublicKey bool,
131131

132132
return nil
133133
case print.YAMLOutputFormat:
134-
details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true))
134+
details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
135135
if showOnlyPublicKey {
136136
onlyPublicKey := map[string]string{
137137
"publicKey": *keyPair.PublicKey,
138138
}
139-
details, err = yaml.MarshalWithOptions(onlyPublicKey, yaml.IndentSequence(true))
139+
details, err = yaml.MarshalWithOptions(onlyPublicKey, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
140140
}
141141

142142
if err != nil {

internal/cmd/beta/key-pair/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func outputResult(p *print.Printer, outputFormat string, keyPairs []iaas.Keypair
146146
p.Outputln(string(details))
147147

148148
case print.YAMLOutputFormat:
149-
details, err := yaml.MarshalWithOptions(keyPairs, yaml.IndentSequence(true))
149+
details, err := yaml.MarshalWithOptions(keyPairs, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
150150
if err != nil {
151151
return fmt.Errorf("marshal key pairs: %w", err)
152152
}

internal/cmd/beta/key-pair/update/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func outputResult(p *print.Printer, model inputModel, keyPair iaas.Keypair) erro
135135
}
136136
p.Outputln(string(details))
137137
case print.YAMLOutputFormat:
138-
details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true))
138+
details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
139139
if err != nil {
140140
return fmt.Errorf("marshal key pair: %w", err)
141141
}

internal/cmd/beta/network-area/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func outputResult(p *print.Printer, model *inputModel, orgLabel string, networkA
189189

190190
return nil
191191
case print.YAMLOutputFormat:
192-
details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true))
192+
details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
193193
if err != nil {
194194
return fmt.Errorf("marshal network area: %w", err)
195195
}

internal/cmd/beta/network-area/describe/describe.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, networkArea *iaas.Netwo
137137

138138
return nil
139139
case print.YAMLOutputFormat:
140-
details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true))
140+
details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
141141
if err != nil {
142142
return fmt.Errorf("marshal network area: %w", err)
143143
}

internal/cmd/beta/network-area/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func outputResult(p *print.Printer, outputFormat string, networkAreas []iaas.Net
152152

153153
return nil
154154
case print.YAMLOutputFormat:
155-
details, err := yaml.MarshalWithOptions(networkAreas, yaml.IndentSequence(true))
155+
details, err := yaml.MarshalWithOptions(networkAreas, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
156156
if err != nil {
157157
return fmt.Errorf("marshal area: %w", err)
158158
}

internal/cmd/beta/network-area/network-range/create/create.go

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

150150
return nil
151151
case print.YAMLOutputFormat:
152-
details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true))
152+
details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
153153
if err != nil {
154154
return fmt.Errorf("marshal network range: %w", err)
155155
}

0 commit comments

Comments
 (0)