Skip to content

Commit a49755e

Browse files
committed
Fix examples name convention for godoc.
Signed-off-by: Eric Myhre <hash@exultant.us>
1 parent 9b85219 commit a49755e

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

example_test.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)