diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-11-30 15:45:45 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-11-30 16:04:42 +0100 |
| commit | 637d4d4ce5bbd9d1908d1e7f577c06040ee7dbcf (patch) | |
| tree | ded1651d1e10504f17bc319cb28d32767c152960 /tools/syz-linter/testdata | |
| parent | 7b59f488eec128a2903af7a6e2eefa967eaa8a33 (diff) | |
tools/syz-linter: warn about inconsistent flag definitions
Diffstat (limited to 'tools/syz-linter/testdata')
| -rw-r--r-- | tools/syz-linter/testdata/src/lintertest/lintertest.go | 8 |
1 files changed, 8 insertions, 0 deletions
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") |
