Skip to content

Commit

Permalink
Merge branch 'master' of github.com:golobby/config
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi committed Feb 21, 2021
2 parents ade0ea9 + ac462d1 commit 0663778
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It requires Go `v1.11` or newer versions.
To install this package run the following command in the root of your project

```bash
go get github.com/golobby/config
go get github.com/golobby/config/v2
```

### Getting Started
Expand Down Expand Up @@ -82,6 +82,7 @@ c, err := config.New(feeder.Map{
"band": "Pink Floyd",
"year": 1979,
"rate": 4.6,
"like": true,
})

name, err := c.Get("name")
Expand All @@ -92,9 +93,15 @@ year, err := c.Get("year")
// OR
year, err := c.GetInt("year")

year, err := c.Get("rate")
rate, err := c.Get("rate")
// OR
duration, err := c.GetFloat("rate")
rate, err := c.GetFloat("rate")

rate, err := c.Get("like")
// OR
rate, err := c.GetBool("like")
// OR
rate, err := c.GetStrictBool("like")
```

#### Feeding using Json
Expand Down

0 comments on commit 0663778

Please sign in to comment.