Clean up documentation (#168)

Fixes #135
This commit is contained in:
Thomas Pelletier
2017-05-30 18:33:25 -07:00
committed by GitHub
parent 26ae43fdee
commit 40ecdac242
8 changed files with 124 additions and 135 deletions
+19
View File
@@ -177,6 +177,25 @@ 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{}