Skip to content

Commit 0b1645d

Browse files
authored
Set the default line length to infinity (-1) (go-yaml#571)
1 parent 53403b5 commit 0b1645d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

apic.go

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func yaml_emitter_initialize(emitter *yaml_emitter_t) {
8686
raw_buffer: make([]byte, 0, output_raw_buffer_size),
8787
states: make([]yaml_emitter_state_t, 0, initial_stack_size),
8888
events: make([]yaml_event_t, 0, initial_queue_size),
89+
best_width: -1,
8990
}
9091
}
9192

encode_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ var marshalTests = []struct {
397397
map[string]interface{}{"a": jsonNumberT("bogus")},
398398
"a: bogus\n",
399399
},
400+
// Ensure that strings do not wrap
401+
{
402+
map[string]string{"a": "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 "},
403+
"a: 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 '\n",
404+
},
400405
}
401406

402407
func (s *S) TestMarshal(c *C) {

0 commit comments

Comments
 (0)