From 881ee3a093f00ed153e00e3289134241d2bed153 Mon Sep 17 00:00:00 2001 From: Viktor Alenkov Date: Thu, 22 Aug 2024 08:52:21 +0300 Subject: [PATCH] Corrected the method names --- env.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/env.go b/env.go index 00c813e..171013c 100644 --- a/env.go +++ b/env.go @@ -87,13 +87,13 @@ 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) @@ -101,7 +101,7 @@ func parserURL(v string) (interface{}, error) { 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) @@ -109,7 +109,7 @@ func parserDuration(v string) (interface{}, error) { 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)