You do not have to worry while he is "doing his job." But the current encoding/gobimplementation is deterministic. But (keep reading)!
WITH
The flow of throats is self-describing. Each data item in the stream is preceded by a specification of its type, expressed in terms of a small set of predefined types.
, , , . , , . , , , , ref (, ) .
. :
type Int struct{ X int }
b := &bytes.Buffer{}
e := gob.NewEncoder(b)
e.Encode(Int{1})
fmt.Println(b.Bytes())
e.Encode(Int{1})
fmt.Println(b.Bytes())
e.Encode(Int{1})
fmt.Println(b.Bytes())
( ):
[23 255 129 3 1 1 3 73 110 116 1 255 130 0 1 1 1 1 88 1 4 0 0 0 5 255 130 1 2 0]
[23 255 129 3 1 1 3 73 110 116 1 255 130 0 1 1 1 1 88 1 4 0 0 0 5 255 130 1 2 0 5 255 130 1 2 0]
[23 255 129 3 1 1 3 73 110 116 1 255 130 0 1 1 1 1 88 1 4 0 0 0 5 255 130 1 2 0 5 255 130 1 2 0 5 255 130 1 2 0]
, Encode() Int [5 255 130 1 2 0], [5 255 130 1 2 0].
2 gob.Encoder, , .
, " ". , , / , , , / /id.
, gob . ( , - ), , . Go ( ).