Go Package encoding: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://golang.org/pkg/enconding/ * https://golang.org/pkg/enconding/gob =Internal= * Standard Library =Overview=")
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=


* https://golang.org/pkg/enconding/
* https://golang.org/pkg/encoding/
* https://golang.org/pkg/enconding/gob
* https://golang.org/pkg/encoding/gob
* https://golang.org/pkg/encoding/json
* https://golang.org/pkg/encoding/xml
 


=Internal=
=Internal=


* [[Go Concepts - Standard Library#Packages|Standard Library]]
* [[Go_Language_Modularization#encoding|Standard Library]]


=Overview=
=Overview=
The package "gob" manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting arguments and results of remote procedure calls (RPCs) such as those provided by package "net/rpc".
The package "json" provides support for encoding and decoding JSON.
=JSON=
<font color=red>'''TODO''' github recipe</font>
<pre>
var as []*A
err = json.NewDecoder(file).Decode(&as)
</pre>
=XML=
<font color=red>
'''TODO''' github recipe
An example available in "Go in Action" page 56.
</font>

Latest revision as of 22:16, 6 September 2023

External


Internal

Overview

The package "gob" manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting arguments and results of remote procedure calls (RPCs) such as those provided by package "net/rpc".

The package "json" provides support for encoding and decoding JSON.

JSON

TODO github recipe

var as []*A

err = json.NewDecoder(file).Decode(&as)

XML

TODO github recipe

An example available in "Go in Action" page 56.