diff --git a/example/full/cmd.go b/example/full/cmd.go index 8559212..89ef7cc 100644 --- a/example/full/cmd.go +++ b/example/full/cmd.go @@ -37,9 +37,10 @@ package main import ( "encoding/json" "fmt" + "time" + "github.com/mars315/autoflags" "github.com/spf13/cobra" - "time" ) func main() { diff --git a/example/simple/cmd.go b/example/simple/cmd.go index ffdede0..820708b 100644 --- a/example/simple/cmd.go +++ b/example/simple/cmd.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/mars315/autoflags" "github.com/spf13/cobra" ) diff --git a/flag.go b/flag.go index 4f3d467..9a107dd 100644 --- a/flag.go +++ b/flag.go @@ -66,11 +66,11 @@ package autoflags import ( "fmt" - "github.com/mars315/autoflags/lib/stringx" "reflect" "strings" "time" + "github.com/mars315/autoflags/lib/stringx" "github.com/mitchellh/mapstructure" "github.com/spf13/cobra" flag "github.com/spf13/pflag" @@ -430,7 +430,6 @@ func parseTag(field reflect.StructField, cfg *FlagConfig) *tagData { // getTag . func getTag(field reflect.StructField, cfg *FlagConfig) *tagData { - fulls, ok := field.Tag.Lookup(cfg.tagName) // ignore untagged field diff --git a/lib/stringx/string.go b/lib/stringx/string.go index d7e9fe4..fb9e9df 100644 --- a/lib/stringx/string.go +++ b/lib/stringx/string.go @@ -7,9 +7,10 @@ package stringx import ( - "github.com/mars315/autoflags/lib/builtin" "strconv" "strings" + + "github.com/mars315/autoflags/lib/builtin" ) func ToBool(s string) bool {