From fdc58c2ff6855abdd9f0f252e91ebe6306bc7c7c Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 25 Apr 2019 07:42:54 -0300 Subject: [PATCH] fix: remove OnEnvVarSet close #71 --- env.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/env.go b/env.go index 40f5b7b..04f3e3f 100644 --- a/env.go +++ b/env.go @@ -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) { @@ -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 }