Skip to content

Commit

Permalink
fix: remove OnEnvVarSet
Browse files Browse the repository at this point in the history
close #71
  • Loading branch information
caarlos0 committed Apr 25, 2019
1 parent ccc4466 commit fdc58c2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ var (
// ErrNotAStructPtr is returned if you pass something that is not a pointer to a
// Struct to Parse
ErrNotAStructPtr = errors.New("env: expected a pointer to a Struct")
// OnEnvVarSet is an optional convenience callback, such as for logging purposes.
// If not nil, it's called after successfully setting the given field from the given value.
OnEnvVarSet func(reflect.StructField, string)

defaultBuiltInParsers = map[reflect.Kind]ParserFunc{
reflect.Bool: func(v string) (interface{}, error) {
Expand Down Expand Up @@ -142,10 +139,6 @@ func doParse(ref reflect.Value, funcMap CustomParsers) error {
if err := set(refField, refTypeField, value, funcMap); err != nil {
return err
}
// TODO: change this to a param instead of global
if OnEnvVarSet != nil {
OnEnvVarSet(refTypeField, value)
}
}
return nil
}
Expand Down

0 comments on commit fdc58c2

Please sign in to comment.