@@ -502,18 +502,42 @@ linters:
502
502
default-case-required : true
503
503
504
504
exhaustruct :
505
- # List of regular expressions to match struct packages and their names.
506
- # Regular expressions must match complete canonical struct package/name/structname.
507
- # If this list is empty, all structs are tested.
505
+ # List of regular expressions to match type names that should be processed.
506
+ # Anonymous structs can be matched by '<anonymous>' alias.
507
+ #
508
+ # Each regular expression must match the full type name, including package path.
509
+ # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
510
+ # but not `http\.Cookie`.
508
511
# Default: []
509
512
include :
510
513
- ' .+\.Test'
511
514
- ' example\.com/package\.ExampleStruct[\d]{1,2}'
512
- # List of regular expressions to exclude struct packages and their names from checks.
513
- # Regular expressions must match complete canonical struct package/name/structname.
515
+ # List of regular expressions to match type names that should be excluded from processing.
516
+ # Anonymous structs can be matched by '<anonymous>' alias.
517
+ # Has precedence over `include`.
518
+ # Each regular expression must match the full type name, including package path.
519
+ # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
520
+ # but not `http\.Cookie`.
514
521
# Default: []
515
522
exclude :
516
523
- ' .+/cobra\.Command$'
524
+ # Allows empty structures, effectively excluding them from the check.
525
+ # Default: false
526
+ allow-empty : true
527
+ # List of regular expressions to match type names that should be allowed to be empty.
528
+ # Anonymous structs can be matched by '<anonymous>' alias.
529
+ # Each regular expression must match the full type name, including package path.
530
+ # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
531
+ # but not `http\.Cookie`.
532
+ # Default: []
533
+ allow-empty-rx :
534
+ - ' .*/http\.Cookie'
535
+ # Allows empty structures in return statements.
536
+ # Default: false
537
+ allow-empty-returns : true
538
+ # Allows empty structures in variable declarations.
539
+ # Default: false
540
+ allow-empty-declarations : true
517
541
518
542
fatcontext :
519
543
# Check for potential fat contexts in struct pointers.
0 commit comments