Skip to content

Commit

Permalink
Corrected the method names
Browse files Browse the repository at this point in the history
  • Loading branch information
BorzdeG committed Aug 22, 2024
1 parent cb0fcf5 commit 881ee3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,29 @@ var (

func defaultTypeParsers() map[reflect.Type]ParserFunc {
return map[reflect.Type]ParserFunc{
reflect.TypeOf(url.URL{}): parserURL,
reflect.TypeOf(time.Nanosecond): parserDuration,
reflect.TypeOf(time.Location{}): parserLocation,
reflect.TypeOf(url.URL{}): parseURL,
reflect.TypeOf(time.Nanosecond): parseDuration,
reflect.TypeOf(time.Location{}): parseLocation,
}
}

func parserURL(v string) (interface{}, error) {
func parseURL(v string) (interface{}, error) {
u, err := url.Parse(v)
if err != nil {
return nil, newParseValueError("unable to parse URL", err)
}
return *u, nil
}

func parserDuration(v string) (interface{}, error) {
func parseDuration(v string) (interface{}, error) {
d, err := time.ParseDuration(v)
if err != nil {
return nil, newParseValueError("unable to parse duration", err)
}
return d, err
}

func parserLocation(v string) (interface{}, error) {
func parseLocation(v string) (interface{}, error) {
loc, err := time.LoadLocation(v)
if err != nil {
return nil, newParseValueError("unable to parse location", err)
Expand Down

0 comments on commit 881ee3a

Please sign in to comment.