1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00

code cleanup (#1054)

This commit is contained in:
chavacava
2024-10-01 12:14:02 +02:00
committed by GitHub
parent 798ce21849
commit ca2a32b087
30 changed files with 326 additions and 263 deletions

View File

@@ -16,10 +16,12 @@ type DeferRule struct {
func (r *DeferRule) configure(arguments lint.Arguments) {
r.Lock()
if r.allow == nil {
r.allow = r.allowFromArgs(arguments)
defer r.Unlock()
if r.allow != nil {
return // already configured
}
r.Unlock()
r.allow = r.allowFromArgs(arguments)
}
// Apply applies the rule to given file.