15 # go-code: Keep an operation with its immediate error check.
23 # go-code: Keep a short declaration with its immediate use.
24 allow-first-in-block: true
25 allow-whole-block: true
26 cuddle-max-statements: 2
28 # go-code: Keep a short declaration with its immediate assignment use.
30 # go-code: Keep a short declaration, its operation, and its error check
33 # go-code: A short declaration can feed the next loop setup.
35 # go-code: A short declaration can feed the next switch setup.
37 # go-code: Keep a declared cleanup with its immediate defer.
39 # go-code: Keep a short declaration with its immediate append use.
41 # go-code: Keep a short declaration with its immediate worker setup.
44 # go-code: Keep a short declaration with its immediate use.
47 # go-code: Return ctx.Err() directly.
49 - "(context.Context).Err() error"
52 # go-code: A function with one error path can return it directly.
53 - linters: [wrapcheck]
55 source: 'return r\.file\.Close\(\)'
56 - linters: [wrapcheck]
58 source: 'return os\.Truncate\('
59 - linters: [wrapcheck]
60 path: ^sync_buffer_helper_test\.go$
61 source: 'return b\.buffer\.Write\('
62 - linters: [wrapcheck]
64 source: 'return s\.inner\.Summarize\('
65 - linters: [wrapcheck]
67 source: 'return false, err'
68 - linters: [wrapcheck]
70 text: 'sqlstore\.Container\)\.Close\('