From 1eaa882c3a79436f5409598b0f4b7cc22260ba16 Mon Sep 17 00:00:00 2001 From: Summer Mousa Date: Tue, 15 Apr 2014 09:57:11 -0500 Subject: [PATCH] removed extranneous value method on the generic type --- context.go | 2 +- flag.go | 1 - flag_test.go | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/context.go b/context.go index ecad026..5178ca4 100644 --- a/context.go +++ b/context.go @@ -197,7 +197,7 @@ func lookupIntSlice(name string, set *flag.FlagSet) []int { func lookupGeneric(name string, set *flag.FlagSet) interface{} { f := set.Lookup(name) if f != nil { - return (f.Value.(Generic)).Value() + return f.Value } return nil } diff --git a/flag.go b/flag.go index 87085eb..85c21df 100644 --- a/flag.go +++ b/flag.go @@ -41,7 +41,6 @@ func eachName(longName string, fn func(string)) { type Generic interface { Set(value string) error String() string - Value() interface{} } // GenericFlag is the flag type for types implementing Generic diff --git a/flag_test.go b/flag_test.go index 346e409..1c05f01 100644 --- a/flag_test.go +++ b/flag_test.go @@ -176,10 +176,6 @@ func (p *Parser) String() string { return fmt.Sprintf("%s,%s", p[0], p[1]) } -func (p *Parser) Value() interface{} { - return p -} - func TestParseGeneric(t *testing.T) { a := cli.App{ Flags: []cli.Flag{