Skip to content

Commit

Permalink
chore: upgrade ecp to v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wrfly authored and shaun.fu committed Jan 7, 2020
1 parent 633a6cc commit 2f7e690
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/wrfly/gua

go 1.12

require github.com/wrfly/ecp v0.1.1-0.20190725160759-97269b9e95f0
require github.com/wrfly/ecp v0.1.3
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
github.com/wrfly/ecp v0.0.0-20190321163603-bbc550e18246 h1:DZkmqllKFxC++nqcKKYZgO2U1pZJzwQw+8n7fEhOJfk=
github.com/wrfly/ecp v0.0.0-20190321163603-bbc550e18246/go.mod h1:lTrjsp9nYtempzKMd5XzGjU1MraaXFrhPTs8WhC3DFU=
github.com/wrfly/ecp v0.0.0-20190321181722-563aa2b61fa2 h1:sZ96zRMTzmnhft2+iACUlzWzF4CtlA1uTkLN7xLznOQ=
github.com/wrfly/ecp v0.0.0-20190321181722-563aa2b61fa2/go.mod h1:lTrjsp9nYtempzKMd5XzGjU1MraaXFrhPTs8WhC3DFU=
github.com/wrfly/ecp v0.1.0 h1:btwZO5LGlM5SNykaUXGkJIjwckpjPU2MjFatehSCmY8=
github.com/wrfly/ecp v0.1.0/go.mod h1:cmmFTD+MLlrDa3/EO3gjeKLKUhHiYP3cgaaJamIS1NU=
github.com/wrfly/ecp v0.1.1-0.20190725160759-97269b9e95f0 h1:Zy3Chk4CvwAqJ6YgQym6hJQEk4JE7iPbHRfxkru6Zn0=
github.com/wrfly/ecp v0.1.1-0.20190725160759-97269b9e95f0/go.mod h1:cmmFTD+MLlrDa3/EO3gjeKLKUhHiYP3cgaaJamIS1NU=
github.com/wrfly/ecp v0.1.3 h1:xu7fjaU05sFHe+3giB4R+mwSUNCiB2Kk8QvQy8OawcI=
github.com/wrfly/ecp v0.1.3/go.mod h1:cmmFTD+MLlrDa3/EO3gjeKLKUhHiYP3cgaaJamIS1NU=
7 changes: 2 additions & 5 deletions gua.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ func (g *gua) getFlagValue(field reflect.Value, key string) (string, bool) {
return "", false
}

func init() {
// reset lookup key function
ecp.LookupKey = func(original, _, _ string) string { return original }
}

type key struct {
name string
value *string
Expand Down Expand Up @@ -102,8 +97,10 @@ func ParseWithFlagSet(c interface{}, f *flag.FlagSet) error {

frog := gua{make(map[string]key, 20), f}

ecp := ecp.New()
ecp.GetKey = frog.getKey
ecp.LookupValue = frog.getFlagValue
ecp.LookupKey = func(original, _, _ string) string { return original }

if err := ecp.Parse(c, ""); err != nil {
return err
Expand Down

0 comments on commit 2f7e690

Please sign in to comment.