Read from the beginning, contains sufficient information that the entire Textual representations,Įxemplified by XML and JSON, are too slow to put at the center of an efficient On the other hand, this approach means that gobs will never work as wellĮfficiency is also important. The data structure itself is all the package should need to figure out how The gob package was designed with a number of goals in mind.įirst, and most obvious, it had to be very easy to use.įirst, because Go has reflection, there is no need for a separate interfaceĭefinition language or “protocol compiler”. ![]() Gobs work with the language in a way that an externally-defined,Īt the same time, there are lessons to be learned from the existing systems. There’s an opportunity to build something much easier to use and possibly more efficient. Is in a separate repository but it’s one of the most frequently downloaded).Īnd for many purposes, including communicating with tools and systems written in other languages,īut for a Go-specific environment, such as communicating between two servers written in Go, Just mentioned (the protocol buffer package Go has packages supporting all the encodings Why not just use one of the existing formats? Well, Why define a new encoding? It’s a lot of work and redundant at that. There are many encodings available, of course:Īnd now there’s another, provided by Go’s gob package. It must be encoded and then decoded again. ![]() To transmit a data structure across a network or to store it in a file,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |