Fix Marshal examples (#178)

* Fix Marshal examples
* Move ExampleMarshal to doc test
This commit is contained in:
178inaba
2017-08-17 09:06:23 +09:00
committed by Thomas Pelletier
parent 69d355db53
commit 4692b8f9ba
2 changed files with 51 additions and 23 deletions
-19
View File
@@ -177,25 +177,6 @@ func TestDocUnmarshal(t *testing.T) {
}
}
func ExampleUnmarshal() {
type Postgres struct {
User string
Password string
}
type Config struct {
Postgres Postgres
}
doc := []byte(`
[postgres]
user = "pelletier"
password = "mypassword"`)
config := Config{}
Unmarshal(doc, &config)
fmt.Println("user=", config.Postgres.User)
}
func TestDocPartialUnmarshal(t *testing.T) {
result := testDocSubs{}