From 637d4d4ce5bbd9d1908d1e7f577c06040ee7dbcf Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 30 Nov 2020 15:45:45 +0100 Subject: tools/syz-linter: warn about inconsistent flag definitions --- tools/syz-linter/testdata/src/lintertest/lintertest.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/syz-linter/testdata/src') diff --git a/tools/syz-linter/testdata/src/lintertest/lintertest.go b/tools/syz-linter/testdata/src/lintertest/lintertest.go index 9fb1d89c9..778ccb6ae 100644 --- a/tools/syz-linter/testdata/src/lintertest/lintertest.go +++ b/tools/syz-linter/testdata/src/lintertest/lintertest.go @@ -4,6 +4,7 @@ package lintertest import ( + "flag" "fmt" "log" "os" @@ -56,6 +57,13 @@ func funcArgsBad1() (a int, b int) { // want "Use 'a, b int'" func funcArgsBad2(a int16, b, c uint32, d uint32, e int16) { // want "Use 'b, c, d uint32'" } +func flagDefinitions() { + flag.Int("good", 0, "fine description") + flag.Int("camelCase", 0, "fine description") // want "Don't use Capital letters in flag names" + flag.String("fine", "", "Capital Letter") // want "Don't start flag description with a Capital letter" + flag.Bool("fine", false, "dot at the end.") // want "Don't use '.' at the end of flag description" +} + func logErrorMessages() { msg := "good message" err := fmt.Errorf("good message") -- cgit mrf-deployment