From 6f072c51da6aad755e692c73019db1ec03c0bfef Mon Sep 17 00:00:00 2001 From: liaohanqin Date: Mon, 16 Aug 2021 15:14:20 +0800 Subject: [PATCH] remove lint warnning --- main.go | 2 +- output.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 8553d79..ac4235c 100644 --- a/main.go +++ b/main.go @@ -127,7 +127,7 @@ func main() { } if flag.NArg() != 1 { - fmt.Fprintf(os.Stderr, Usage) + fmt.Fprint(os.Stderr, Usage) flag.PrintDefaults() os.Exit(2) } diff --git a/output.go b/output.go index 6ba7889..c8f137b 100644 --- a/output.go +++ b/output.go @@ -35,9 +35,10 @@ func printOutput( ) ([]byte, error) { var groupType, groupPkg bool for _, g := range groupBy { - if g == "pkg" { + switch g { + case "pkg": groupPkg = true - } else if g == "type" { + case "type": groupType = true } } @@ -285,7 +286,7 @@ func printOutput( Attrs: dotAttrs{ "penwidth": "0.8", "fontsize": "16", - "label": fmt.Sprintf("%s", label), + "label": label, "style": "filled", "fillcolor": "lightyellow", "URL": fmt.Sprintf("/?f=%s", key),