From 42f28ab8e374137fe3f5d25424489d879d4724f8 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 21 Jun 2017 19:06:17 -0700 Subject: Updating server dependancies (#6712) --- vendor/github.com/pelletier/go-toml/marshal_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'vendor/github.com/pelletier/go-toml/marshal_test.go') diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.go b/vendor/github.com/pelletier/go-toml/marshal_test.go index dbfc7c1d1..a3fa128d2 100644 --- a/vendor/github.com/pelletier/go-toml/marshal_test.go +++ b/vendor/github.com/pelletier/go-toml/marshal_test.go @@ -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{} -- cgit v1.2.3-1-g7c22