Skip to content

Commit

Permalink
Merge pull request jinzhu#3 from c4s4/master
Browse files Browse the repository at this point in the history
Provide a functional example code
  • Loading branch information
jinzhu committed Sep 2, 2015
2 parents 1e903b0 + 45ddba7 commit cfb8add
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Golang Configuration tool that support YAML, JSON, Shell Environment
# Usage

```go
package main

import (
"fmt"
"github.com/jinzhu/configor"
)

Expand All @@ -25,7 +28,26 @@ var Config = struct {
}
}{}

configor.Load(&Config, "config.yml", "config.json"...)
func main() {
configor.Load(&Config, "config.yml")
fmt.Printf("config: %#v", Config)
}
```

With configuration file *config.yml*:

```yaml
APPName: test

DB:
Name: test
User: test
Password: test
Port: 1234

Contacts:
- Name: i test
Email: [email protected]
```
# Advanced Usage
Expand Down

0 comments on commit cfb8add

Please sign in to comment.