From 33dffdb4c1859bfb3dc735798b441232c6290705 Mon Sep 17 00:00:00 2001 From: Oleg Repin Date: Sat, 20 Jun 2020 14:31:21 +0300 Subject: [PATCH] add details to readme --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62288ca..39bb5b2 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ e.Unmarshal(&config) package main import ( - "github.com/spf13/viper" "github.com/iamolegga/enviper" + "github.com/spf13/viper" ) type barry struct { @@ -45,6 +45,22 @@ type config struct { Bazzy bazzy `mapstructure:",squash"` } +// For example this kind of structure can be unmarshaled with next yaml: +// Foo: foo +// Barry: +// bar: 42 +// Baz: true +// +// And then it could be overriden by next env variables: +// FOO=foo +// BARRY_BAR=42 +// BAZ=true +// +// Or with prefix: +// MYAPP_FOO=foo +// MYAPP_BARRY_BAR=42 +// MYAPP_BAZ=true + func main() { var c config