Skip to content

Commit

Permalink
improve doc
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Bourgon <peterbourgon@users.noreply.github.com>
  • Loading branch information
dolanor and peterbourgon committed Jul 24, 2020
1 parent c037c0b commit 984ec17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ffenv/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ func parse(prefix string, r io.Reader, set func(name, value string) error) error
return nil
}

// ParserWithPrefix removes any prefix_ on keys in a .env file.
// MY_APP_PREFIX_KEY=value will get evaluated as key=value.
// ParserWithPrefix returns a Parser that will remove any prefix on keys in an
// .env file. For example, given prefix "MY_APP", the line `MY_APP_FOO=bar`
// in an .env file will be evaluated as name=foo, value=bar.
func ParserWithPrefix(prefix string) func(io.Reader, func(string, string) error) error {
return func(r io.Reader, set func(name, value string) error) error {
return parse(prefix, r, set)
Expand Down

0 comments on commit 984ec17

Please sign in to comment.