diff options
Diffstat (limited to 'src/encoding')
| -rw-r--r-- | src/encoding/gob/doc.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/encoding/gob/doc.go b/src/encoding/gob/doc.go index c746806887..390f25088e 100644 --- a/src/encoding/gob/doc.go +++ b/src/encoding/gob/doc.go @@ -153,16 +153,16 @@ are transmitted, even if all the elements are zero. Structs are sent as a sequence of (field number, field value) pairs. The field value is sent using the standard gob encoding for its type, recursively. If a -field has the zero value for its type (except for arrays; see above), it is omitted -from the transmission. The field number is defined by the type of the encoded -struct: the first field of the encoded type is field 0, the second is field 1, -etc. When encoding a value, the field numbers are delta encoded for efficiency -and the fields are always sent in order of increasing field number; the deltas are -therefore unsigned. The initialization for the delta encoding sets the field -number to -1, so an unsigned integer field 0 with value 7 is transmitted as unsigned -delta = 1, unsigned value = 7 or (01 07). Finally, after all the fields have been -sent a terminating mark denotes the end of the struct. That mark is a delta=0 -value, which has representation (00). +field has the zero value for its type (except for arrays; see above) or it's a +pointer to a zero value, it is omitted from the transmission. The field number +is defined by the type of the encoded struct: the first field of the encoded type +is field 0, the second is field 1, etc. When encoding a value, the field numbers +are delta encoded for efficiency and the fields are always sent in order of +increasing field number; the deltas are therefore unsigned. The initialization +for the delta encoding sets the field number to -1, so an unsigned integer field 0 +with value 7 is transmitted as unsigned delta = 1, unsigned value = 7 or (01 07). +Finally, after all the fields have been sent a terminating mark denotes the end +of the struct. That mark is a delta=0 value, which has representation (00). Interface types are not checked for compatibility; all interface types are treated, for transmission, as members of a single "interface" type, analogous to |
