Преглед изворни кода

codec: update docs on custom encoding/decoding - showing symmetry for Text(M|Unm)arshaler

Updates #286
Ugorji Nwoke пре 6 година
родитељ
комит
e2bddce071
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      codec/0doc.go
  2. 1 1
      codec/README.md

+ 1 - 1
codec/0doc.go

@@ -109,7 +109,7 @@ We determine how to encode or decode by walking this decision tree
   - is there an extension registered for the type?
   - is there an extension registered for the type?
   - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler?
   - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler?
   - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler?
   - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler?
-  - is format text-based, and type an encoding.TextMarshaler?
+  - is format text-based, and type an encoding.TextMarshaler and TextUnmarshaler?
   - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc
   - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc
 
 
 This symmetry is important to reduce chances of issues happening because the
 This symmetry is important to reduce chances of issues happening because the

+ 1 - 1
codec/README.md

@@ -106,7 +106,7 @@ We determine how to encode or decode by walking this decision tree
   - is there an extension registered for the type?
   - is there an extension registered for the type?
   - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler?
   - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler?
   - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler?
   - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler?
-  - is format text-based, and type an encoding.TextMarshaler?
+  - is format text-based, and type an encoding.TextMarshaler and TextUnmarshaler?
   - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc
   - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc
 
 
 This symmetry is important to reduce chances of issues happening because the
 This symmetry is important to reduce chances of issues happening because the