From 87940a7a576cf3d08b89d1c76d48aa39e1b3ca69 Mon Sep 17 00:00:00 2001 From: mars315 <57739378+mars315@users.noreply.github.com> Date: Wed, 3 Jan 2024 19:23:13 +0800 Subject: [PATCH] go fmt --- example/full/cmd.go | 3 ++- example/simple/cmd.go | 1 + flag.go | 3 +-- lib/stringx/string.go | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) 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 {