Skip to content

Commit 2ff61e1

Browse files
authored
Set the default line length to infinity (-1) (go-yaml#572)
1 parent 5308cda commit 2ff61e1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

apic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func yaml_emitter_initialize(emitter *yaml_emitter_t) {
108108
raw_buffer: make([]byte, 0, output_raw_buffer_size),
109109
states: make([]yaml_emitter_state_t, 0, initial_stack_size),
110110
events: make([]yaml_event_t, 0, initial_queue_size),
111+
best_width: -1,
111112
}
112113
}
113114

encode_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,12 @@ var marshalTests = []struct {
429429
"a: |\n \tB\n \tC\n",
430430
},
431431

432+
// Ensure that strings do not wrap
433+
{
434+
map[string]string{"a": "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 "},
435+
"a: 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 '\n",
436+
},
437+
432438
// yaml.Node
433439
{
434440
&struct {

0 commit comments

Comments
 (0)