Skip to content

Commit

Permalink
add details to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iamolegga committed Jun 20, 2020
1 parent 82e8644 commit 33dffdb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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

Expand Down

0 comments on commit 33dffdb

Please sign in to comment.