Skip to content

Commit

Permalink
Merge pull request #21 from ajanata/fix-readme
Browse files Browse the repository at this point in the history
The - tag skips the field, not marks as optional.
  • Loading branch information
vrischmann authored Dec 28, 2018
2 parents 3089713 + 98ae573 commit d647766
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,18 @@ Optional values
```go
var conf struct {
Name string `envconfig:"optional"`
Age int `envconfig:"-"`
}
```

The two syntax are equivalent.
Skipping fields
---------------

*envconfig* supports skipping struct fields:
```go
var conf struct {
Internal string `envconfig:"-"`
}
```

Combining multiple options in one tag
-------------------------------------
Expand Down
9 changes: 7 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,15 @@ Sometimes you don't absolutely need a value. Here's how we tell envconfig a valu
var conf struct {
Name string `envconfig:"optional"`
Age int `envconfig:"-"`
}
The two syntax are equivalent.
Skipped fields
Sometimes you want a field to be skipped entirely.
var conf struct {
Internal string `envconfig:"-"`
}
Default values
Expand Down

0 comments on commit d647766

Please sign in to comment.