Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9f6de01d
Commit
9f6de01d
authored
Dec 14, 2010
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gob: document the byte count used in the encoding of values.
R=rsc CC=golang-dev
https://golang.org/cl/3641041
parent
8b64cd9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
doc.go
src/pkg/gob/doc.go
+7
-2
No files found.
src/pkg/gob/doc.go
View file @
9f6de01d
...
...
@@ -70,7 +70,7 @@ operation will fail.
Structs, arrays and slices are also supported. Strings and arrays of bytes are
supported with a special, efficient representation (see below).
Interfaces, functions,
and channels cannot be sent in a gob. Attempting
Functions
and channels cannot be sent in a gob. Attempting
to encode a value that contains one will fail.
The rest of this comment documents the encoding, details that are not important
...
...
@@ -202,9 +202,14 @@ priori, as well as the basic gob types int, uint, etc. Their ids are:
// 22 is slice of fieldType.
mapType 23
Finally, each message created by a call to Encode is preceded by an encoded
unsigned integer count of the number of bytes remaining in the message. After
the initial type name, interface values are wrapped the same way; in effect, the
interface value acts like a recursive invocation of Encode.
In summary, a gob stream looks like
((-type id, encoding of a wireType)* (type id, encoding of a value))*
(
byteCount
(-type id, encoding of a wireType)* (type id, encoding of a value))*
where * signifies zero or more repetitions and the type id of a value must
be predefined or be defined before the value in the stream.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment