File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,22 @@ import (
1010 "github.com/polydawn/refmt/obj/atlas"
1111)
1212
13- func ExampleJsonEncodeAtlasDefaults () {
13+ func ExampleNewMarshaller_json () {
14+ var buf bytes.Buffer
15+ encoder := refmt .NewMarshaller (json.EncodeOptions {}, & buf )
16+ err := encoder .Marshal (map [string ]interface {}{
17+ "x" : "a" ,
18+ "y" : 1 ,
19+ })
20+ fmt .Println (buf .String ())
21+ fmt .Printf ("%v\n " , err )
22+
23+ // Output:
24+ // {"x":"a","y":1}
25+ // <nil>
26+ }
27+
28+ func ExampleNewMarshallerAtlased_autogeneratedAtlas () {
1429 type MyType struct {
1530 X string
1631 Y int
@@ -36,7 +51,7 @@ func ExampleJsonEncodeAtlasDefaults() {
3651 // <nil>
3752}
3853
39- func ExampleJsonEncodeAtlasCustom () {
54+ func ExampleNewMarshallerAtlased_customStructMapping () {
4055 type MyType struct {
4156 X string
4257 Y int
@@ -64,7 +79,7 @@ func ExampleJsonEncodeAtlasCustom() {
6479 // <nil>
6580}
6681
67- func ExampleJsonEncodeAtlas () {
82+ func ExampleNewMarshallerAtlased_transformFuncs () {
6883 type MyType struct {
6984 X string
7085 Y string
You can’t perform that action at this time.
0 commit comments