diff --git a/cmd/misspell/main.go b/cmd/misspell/main.go index feb9c8b..6dd6012 100644 --- a/cmd/misspell/main.go +++ b/cmd/misspell/main.go @@ -159,7 +159,7 @@ func main() { // // Stuff to ignore // - if len(*ignores) > 0 { + if *ignores != "" { r.RemoveRule(strings.Split(*ignores, ",")) } @@ -188,7 +188,7 @@ func main() { defaultWrite = tmpl defaultRead = tmpl stdout.Println(sqliteHeader) - case len(*format) > 0: + case *format != "": t, err := template.New("custom").Parse(*format) if err != nil { log.Fatalf("Unable to compile log format: %s", err) diff --git a/ignore/glob.go b/ignore/glob.go index fe62152..c95d5f2 100644 --- a/ignore/glob.go +++ b/ignore/glob.go @@ -89,7 +89,7 @@ func NewBaseGlobMatch(arg string, truth bool) (*GlobMatch, error) { // Arg true should be set to false if the output is inverted. func NewPathGlobMatch(arg string, truth bool) (*GlobMatch, error) { // if starts with "/" then glob only applies to top level - if len(arg) > 0 && arg[0] == '/' { + if arg != "" && arg[0] == '/' { arg = arg[1:] } diff --git a/notwords.go b/notwords.go index a250cf7..3e3a4cc 100644 --- a/notwords.go +++ b/notwords.go @@ -20,7 +20,7 @@ var ( func RemovePath(s string) string { out := bytes.Buffer{} var idx int - for len(s) > 0 { + for s != "" { if idx = strings.IndexByte(s, '/'); idx == -1 { out.WriteString(s) break