|
@@ -175,7 +175,7 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) {
|
175
|
175
|
// Zero valued structs will be omitted if all their public
|
176
|
176
|
// fields are zero, unless they implement an IsZero
|
177
|
177
|
// method (see the IsZeroer interface type), in which
|
178
|
|
-// case the field will be included if that method returns true.
|
|
178
|
+// case the field will be excluded if IsZero returns true.
|
179
|
179
|
//
|
180
|
180
|
// flow Marshal using a flow style (useful for structs,
|
181
|
181
|
// sequences and maps).
|
|
@@ -464,3 +464,15 @@ func isZero(v reflect.Value) bool {
|
464
|
464
|
}
|
465
|
465
|
return false
|
466
|
466
|
}
|
|
467
|
+
|
|
468
|
+// FutureLineWrap globally disables line wrapping when encoding long strings.
|
|
469
|
+// This is a temporary and thus deprecated method introduced to faciliate
|
|
470
|
+// migration towards v3, which offers more control of line lengths on
|
|
471
|
+// individual encodings, and has a default matching the behavior introduced
|
|
472
|
+// by this function.
|
|
473
|
+//
|
|
474
|
+// The default formatting of v2 was erroneously changed in v2.3.0 and reverted
|
|
475
|
+// in v2.4.0, at which point this function was introduced to help migration.
|
|
476
|
+func FutureLineWrap() {
|
|
477
|
+ disableLineWrapping = true
|
|
478
|
+}
|