-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable more lint rules (#1376)
* feat: enable `errorlint` lint rule * feat: enable `stylecheck` lint rule without `ST1003` * feat: enable `revive` lint rule without `unused-parameter` * feat: enable `goconst` lint rule * feat: enable `cyclop` `funlen` `gocyclo` `nestif` lint rule * Revert "feat: enable `errorlint` lint rule" This reverts commit 3b56fa9. * Revert "feat: enable `goconst` lint rule" This reverts commit 8cec408.
- Loading branch information
Showing
7 changed files
with
56 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c929fd5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
BenchmarkCachedRaw
17.52
ns/op 0 B/op 0 allocs/op17.53
ns/op 0 B/op 0 allocs/op1.00
BenchmarkCachedRaw - ns/op
17.52
ns/op17.53
ns/op1.00
BenchmarkCachedRaw - B/op
0
B/op0
B/op1
BenchmarkCachedRaw - allocs/op
0
allocs/op0
allocs/op1
BenchmarkCachedBasicModel
168.1
ns/op 104 B/op 4 allocs/op172.8
ns/op 104 B/op 4 allocs/op0.97
BenchmarkCachedBasicModel - ns/op
168.1
ns/op172.8
ns/op0.97
BenchmarkCachedBasicModel - B/op
104
B/op104
B/op1
BenchmarkCachedBasicModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModel
168.2
ns/op 104 B/op 4 allocs/op172.9
ns/op 104 B/op 4 allocs/op0.97
BenchmarkCachedRBACModel - ns/op
168.2
ns/op172.9
ns/op0.97
BenchmarkCachedRBACModel - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelSmall
180.5
ns/op 104 B/op 4 allocs/op183.2
ns/op 104 B/op 4 allocs/op0.99
BenchmarkCachedRBACModelSmall - ns/op
180.5
ns/op183.2
ns/op0.99
BenchmarkCachedRBACModelSmall - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelSmall - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelMedium
181.9
ns/op 104 B/op 4 allocs/op188.9
ns/op 104 B/op 4 allocs/op0.96
BenchmarkCachedRBACModelMedium - ns/op
181.9
ns/op188.9
ns/op0.96
BenchmarkCachedRBACModelMedium - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelMedium - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelLarge
169.1
ns/op 96 B/op 3 allocs/op174.2
ns/op 96 B/op 3 allocs/op0.97
BenchmarkCachedRBACModelLarge - ns/op
169.1
ns/op174.2
ns/op0.97
BenchmarkCachedRBACModelLarge - B/op
96
B/op96
B/op1
BenchmarkCachedRBACModelLarge - allocs/op
3
allocs/op3
allocs/op1
BenchmarkCachedRBACModelWithResourceRoles
171
ns/op 104 B/op 4 allocs/op172.7
ns/op 104 B/op 4 allocs/op0.99
BenchmarkCachedRBACModelWithResourceRoles - ns/op
171
ns/op172.7
ns/op0.99
BenchmarkCachedRBACModelWithResourceRoles - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithResourceRoles - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDomains
184.6
ns/op 120 B/op 4 allocs/op187.9
ns/op 120 B/op 4 allocs/op0.98
BenchmarkCachedRBACModelWithDomains - ns/op
184.6
ns/op187.9
ns/op0.98
BenchmarkCachedRBACModelWithDomains - B/op
120
B/op120
B/op1
BenchmarkCachedRBACModelWithDomains - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedABACModel
2823
ns/op 1541 B/op 18 allocs/op2899
ns/op 1547 B/op 18 allocs/op0.97
BenchmarkCachedABACModel - ns/op
2823
ns/op2899
ns/op0.97
BenchmarkCachedABACModel - B/op
1541
B/op1547
B/op1.00
BenchmarkCachedABACModel - allocs/op
18
allocs/op18
allocs/op1
BenchmarkCachedKeyMatchModel
188.3
ns/op 152 B/op 4 allocs/op196
ns/op 152 B/op 4 allocs/op0.96
BenchmarkCachedKeyMatchModel - ns/op
188.3
ns/op196
ns/op0.96
BenchmarkCachedKeyMatchModel - B/op
152
B/op152
B/op1
BenchmarkCachedKeyMatchModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDeny
171.4
ns/op 104 B/op 4 allocs/op174.1
ns/op 104 B/op 4 allocs/op0.98
BenchmarkCachedRBACModelWithDeny - ns/op
171.4
ns/op174.1
ns/op0.98
BenchmarkCachedRBACModelWithDeny - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithDeny - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedPriorityModel
170.6
ns/op 104 B/op 4 allocs/op173.4
ns/op 104 B/op 4 allocs/op0.98
BenchmarkCachedPriorityModel - ns/op
170.6
ns/op173.4
ns/op0.98
BenchmarkCachedPriorityModel - B/op
104
B/op104
B/op1
BenchmarkCachedPriorityModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedWithEnforceContext
305.3
ns/op 240 B/op 5 allocs/op309.6
ns/op 240 B/op 5 allocs/op0.99
BenchmarkCachedWithEnforceContext - ns/op
305.3
ns/op309.6
ns/op0.99
BenchmarkCachedWithEnforceContext - B/op
240
B/op240
B/op1
BenchmarkCachedWithEnforceContext - allocs/op
5
allocs/op5
allocs/op1
BenchmarkCachedRBACModelMediumParallel
180.6
ns/op 106 B/op 4 allocs/op171.5
ns/op 106 B/op 4 allocs/op1.05
BenchmarkCachedRBACModelMediumParallel - ns/op
180.6
ns/op171.5
ns/op1.05
BenchmarkCachedRBACModelMediumParallel - B/op
106
B/op106
B/op1
BenchmarkCachedRBACModelMediumParallel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkHasPolicySmall
460.1
ns/op 150 B/op 6 allocs/op464.3
ns/op 150 B/op 6 allocs/op0.99
BenchmarkHasPolicySmall - ns/op
460.1
ns/op464.3
ns/op0.99
BenchmarkHasPolicySmall - B/op
150
B/op150
B/op1
BenchmarkHasPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyMedium
502.6
ns/op 157 B/op 6 allocs/op488
ns/op 157 B/op 6 allocs/op1.03
BenchmarkHasPolicyMedium - ns/op
502.6
ns/op488
ns/op1.03
BenchmarkHasPolicyMedium - B/op
157
B/op157
B/op1
BenchmarkHasPolicyMedium - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyLarge
520.3
ns/op 165 B/op 7 allocs/op526.3
ns/op 165 B/op 7 allocs/op0.99
BenchmarkHasPolicyLarge - ns/op
520.3
ns/op526.3
ns/op0.99
BenchmarkHasPolicyLarge - B/op
165
B/op165
B/op1
BenchmarkHasPolicyLarge - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicySmall
486.7
ns/op 152 B/op 6 allocs/op479.3
ns/op 152 B/op 6 allocs/op1.02
BenchmarkAddPolicySmall - ns/op
486.7
ns/op479.3
ns/op1.02
BenchmarkAddPolicySmall - B/op
152
B/op152
B/op1
BenchmarkAddPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkAddPolicyMedium
569.7
ns/op 175 B/op 7 allocs/op579.5
ns/op 176 B/op 7 allocs/op0.98
BenchmarkAddPolicyMedium - ns/op
569.7
ns/op579.5
ns/op0.98
BenchmarkAddPolicyMedium - B/op
175
B/op176
B/op0.99
BenchmarkAddPolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicyLarge
1126
ns/op 470 B/op 9 allocs/op1117
ns/op 470 B/op 9 allocs/op1.01
BenchmarkAddPolicyLarge - ns/op
1126
ns/op1117
ns/op1.01
BenchmarkAddPolicyLarge - B/op
470
B/op470
B/op1
BenchmarkAddPolicyLarge - allocs/op
9
allocs/op9
allocs/op1
BenchmarkRemovePolicySmall
498.3
ns/op 166 B/op 7 allocs/op500
ns/op 166 B/op 7 allocs/op1.00
BenchmarkRemovePolicySmall - ns/op
498.3
ns/op500
ns/op1.00
BenchmarkRemovePolicySmall - B/op
166
B/op166
B/op1
BenchmarkRemovePolicySmall - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyMedium
561.7
ns/op 176 B/op 7 allocs/op550
ns/op 177 B/op 7 allocs/op1.02
BenchmarkRemovePolicyMedium - ns/op
561.7
ns/op550
ns/op1.02
BenchmarkRemovePolicyMedium - B/op
176
B/op177
B/op0.99
BenchmarkRemovePolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyLarge
1267
ns/op 286 B/op 13 allocs/op1220
ns/op 290 B/op 13 allocs/op1.04
BenchmarkRemovePolicyLarge - ns/op
1267
ns/op1220
ns/op1.04
BenchmarkRemovePolicyLarge - B/op
286
B/op290
B/op0.99
BenchmarkRemovePolicyLarge - allocs/op
13
allocs/op13
allocs/op1
BenchmarkRaw
17.52
ns/op 0 B/op 0 allocs/op17.57
ns/op 0 B/op 0 allocs/op1.00
BenchmarkRaw - ns/op
17.52
ns/op17.57
ns/op1.00
BenchmarkRaw - B/op
0
B/op0
B/op1
BenchmarkRaw - allocs/op
0
allocs/op0
allocs/op1
BenchmarkBasicModel
3584
ns/op 1508 B/op 17 allocs/op3589
ns/op 1510 B/op 17 allocs/op1.00
BenchmarkBasicModel - ns/op
3584
ns/op3589
ns/op1.00
BenchmarkBasicModel - B/op
1508
B/op1510
B/op1.00
BenchmarkBasicModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkRBACModel
5446
ns/op 2063 B/op 35 allocs/op5396
ns/op 2070 B/op 35 allocs/op1.01
BenchmarkRBACModel - ns/op
5446
ns/op5396
ns/op1.01
BenchmarkRBACModel - B/op
2063
B/op2070
B/op1.00
BenchmarkRBACModel - allocs/op
35
allocs/op35
allocs/op1
BenchmarkRBACModelSizes/small
49942
ns/op 20295 B/op 480 allocs/op48323
ns/op 20152 B/op 480 allocs/op1.03
BenchmarkRBACModelSizes/small - ns/op
49942
ns/op48323
ns/op1.03
BenchmarkRBACModelSizes/small - B/op
20295
B/op20152
B/op1.01
BenchmarkRBACModelSizes/small - allocs/op
480
allocs/op480
allocs/op1
BenchmarkRBACModelSizes/medium
498616
ns/op 191710 B/op 4827 allocs/op505645
ns/op 191342 B/op 4829 allocs/op0.99
BenchmarkRBACModelSizes/medium - ns/op
498616
ns/op505645
ns/op0.99
BenchmarkRBACModelSizes/medium - B/op
191710
B/op191342
B/op1.00
BenchmarkRBACModelSizes/medium - allocs/op
4827
allocs/op4829
allocs/op1.00
BenchmarkRBACModelSizes/large
5454385
ns/op 1902766 B/op 48265 allocs/op5295330
ns/op 1895942 B/op 48061 allocs/op1.03
BenchmarkRBACModelSizes/large - ns/op
5454385
ns/op5295330
ns/op1.03
BenchmarkRBACModelSizes/large - B/op
1902766
B/op1895942
B/op1.00
BenchmarkRBACModelSizes/large - allocs/op
48265
allocs/op48061
allocs/op1.00
BenchmarkRBACModelSmall
61840
ns/op 20426 B/op 615 allocs/op57864
ns/op 20206 B/op 615 allocs/op1.07
BenchmarkRBACModelSmall - ns/op
61840
ns/op57864
ns/op1.07
BenchmarkRBACModelSmall - B/op
20426
B/op20206
B/op1.01
BenchmarkRBACModelSmall - allocs/op
615
allocs/op615
allocs/op1
BenchmarkRBACModelMedium
585722
ns/op 194746 B/op 6021 allocs/op566602
ns/op 194271 B/op 6020 allocs/op1.03
BenchmarkRBACModelMedium - ns/op
585722
ns/op566602
ns/op1.03
BenchmarkRBACModelMedium - B/op
194746
B/op194271
B/op1.00
BenchmarkRBACModelMedium - allocs/op
6021
allocs/op6020
allocs/op1.00
BenchmarkRBACModelLarge
6077619
ns/op 1940311 B/op 60595 allocs/op6072450
ns/op 1939957 B/op 60589 allocs/op1.00
BenchmarkRBACModelLarge - ns/op
6077619
ns/op6072450
ns/op1.00
BenchmarkRBACModelLarge - B/op
1940311
B/op1939957
B/op1.00
BenchmarkRBACModelLarge - allocs/op
60595
allocs/op60589
allocs/op1.00
BenchmarkRBACModelWithResourceRoles
5164
ns/op 2736 B/op 28 allocs/op5179
ns/op 2728 B/op 28 allocs/op1.00
BenchmarkRBACModelWithResourceRoles - ns/op
5164
ns/op5179
ns/op1.00
BenchmarkRBACModelWithResourceRoles - B/op
2736
B/op2728
B/op1.00
BenchmarkRBACModelWithResourceRoles - allocs/op
28
allocs/op28
allocs/op1
BenchmarkRBACModelWithDomains
5139
ns/op 1826 B/op 25 allocs/op5138
ns/op 1828 B/op 25 allocs/op1.00
BenchmarkRBACModelWithDomains - ns/op
5139
ns/op5138
ns/op1.00
BenchmarkRBACModelWithDomains - B/op
1826
B/op1828
B/op1.00
BenchmarkRBACModelWithDomains - allocs/op
25
allocs/op25
allocs/op1
BenchmarkABACModel
2724
ns/op 1535 B/op 17 allocs/op2771
ns/op 1532 B/op 17 allocs/op0.98
BenchmarkABACModel - ns/op
2724
ns/op2771
ns/op0.98
BenchmarkABACModel - B/op
1535
B/op1532
B/op1.00
BenchmarkABACModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkABACRuleModel
3955015
ns/op 1329244 B/op 40092 allocs/op3843048
ns/op 1321368 B/op 40091 allocs/op1.03
BenchmarkABACRuleModel - ns/op
3955015
ns/op3843048
ns/op1.03
BenchmarkABACRuleModel - B/op
1329244
B/op1321368
B/op1.01
BenchmarkABACRuleModel - allocs/op
40092
allocs/op40091
allocs/op1.00
BenchmarkKeyMatchModel
5930
ns/op 3063 B/op 37 allocs/op6021
ns/op 3065 B/op 37 allocs/op0.98
BenchmarkKeyMatchModel - ns/op
5930
ns/op6021
ns/op0.98
BenchmarkKeyMatchModel - B/op
3063
B/op3065
B/op1.00
BenchmarkKeyMatchModel - allocs/op
37
allocs/op37
allocs/op1
BenchmarkRBACModelWithDeny
6883
ns/op 2480 B/op 49 allocs/op6896
ns/op 2476 B/op 49 allocs/op1.00
BenchmarkRBACModelWithDeny - ns/op
6883
ns/op6896
ns/op1.00
BenchmarkRBACModelWithDeny - B/op
2480
B/op2476
B/op1.00
BenchmarkRBACModelWithDeny - allocs/op
49
allocs/op49
allocs/op1
BenchmarkPriorityModel
4108
ns/op 1760 B/op 22 allocs/op4200
ns/op 1763 B/op 22 allocs/op0.98
BenchmarkPriorityModel - ns/op
4108
ns/op4200
ns/op0.98
BenchmarkPriorityModel - B/op
1760
B/op1763
B/op1.00
BenchmarkPriorityModel - allocs/op
22
allocs/op22
allocs/op1
BenchmarkRBACModelWithDomainPatternLarge
22589
ns/op 16724 B/op 164 allocs/op22604
ns/op 16707 B/op 164 allocs/op1.00
BenchmarkRBACModelWithDomainPatternLarge - ns/op
22589
ns/op22604
ns/op1.00
BenchmarkRBACModelWithDomainPatternLarge - B/op
16724
B/op16707
B/op1.00
BenchmarkRBACModelWithDomainPatternLarge - allocs/op
164
allocs/op164
allocs/op1
BenchmarkRoleManagerSmall
67850
ns/op 11955 B/op 797 allocs/op66702
ns/op 11954 B/op 797 allocs/op1.02
BenchmarkRoleManagerSmall - ns/op
67850
ns/op66702
ns/op1.02
BenchmarkRoleManagerSmall - B/op
11955
B/op11954
B/op1.00
BenchmarkRoleManagerSmall - allocs/op
797
allocs/op797
allocs/op1
BenchmarkRoleManagerMedium
716473
ns/op 125915 B/op 8741 allocs/op702469
ns/op 125914 B/op 8741 allocs/op1.02
BenchmarkRoleManagerMedium - ns/op
716473
ns/op702469
ns/op1.02
BenchmarkRoleManagerMedium - B/op
125915
B/op125914
B/op1.00
BenchmarkRoleManagerMedium - allocs/op
8741
allocs/op8741
allocs/op1
BenchmarkRoleManagerLarge
7521004
ns/op 1349923 B/op 89741 allocs/op7711008
ns/op 1349925 B/op 89741 allocs/op0.98
BenchmarkRoleManagerLarge - ns/op
7521004
ns/op7711008
ns/op0.98
BenchmarkRoleManagerLarge - B/op
1349923
B/op1349925
B/op1.00
BenchmarkRoleManagerLarge - allocs/op
89741
allocs/op89741
allocs/op1
BenchmarkBuildRoleLinksWithPatternLarge
6041007016
ns/op 5344877360 B/op 60949265 allocs/op5811966746
ns/op 5328455512 B/op 60945371 allocs/op1.04
BenchmarkBuildRoleLinksWithPatternLarge - ns/op
6041007016
ns/op5811966746
ns/op1.04
BenchmarkBuildRoleLinksWithPatternLarge - B/op
5344877360
B/op5328455512
B/op1.00
BenchmarkBuildRoleLinksWithPatternLarge - allocs/op
60949265
allocs/op60945371
allocs/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge
166841987
ns/op 141651934 B/op 1676512 allocs/op164412824
ns/op 141728643 B/op 1676514 allocs/op1.01
BenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op
166841987
ns/op164412824
ns/op1.01
BenchmarkBuildRoleLinksWithDomainPatternLarge - B/op
141651934
B/op141728643
B/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - allocs/op
1676512
allocs/op1676514
allocs/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge
6276031932
ns/op 5484715584 B/op 62560400 allocs/op6240346242
ns/op 5489362736 B/op 62560690 allocs/op1.01
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op
6276031932
ns/op6240346242
ns/op1.01
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - B/op
5484715584
B/op5489362736
B/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - allocs/op
62560400
allocs/op62560690
allocs/op1.00
BenchmarkHasLinkWithPatternLarge
10247
ns/op 7609 B/op 111 allocs/op10273
ns/op 7593 B/op 111 allocs/op1.00
BenchmarkHasLinkWithPatternLarge - ns/op
10247
ns/op10273
ns/op1.00
BenchmarkHasLinkWithPatternLarge - B/op
7609
B/op7593
B/op1.00
BenchmarkHasLinkWithPatternLarge - allocs/op
111
allocs/op111
allocs/op1
BenchmarkHasLinkWithDomainPatternLarge
475.9
ns/op 80 B/op 5 allocs/op476.5
ns/op 80 B/op 5 allocs/op1.00
BenchmarkHasLinkWithDomainPatternLarge - ns/op
475.9
ns/op476.5
ns/op1.00
BenchmarkHasLinkWithDomainPatternLarge - B/op
80
B/op80
B/op1
BenchmarkHasLinkWithDomainPatternLarge - allocs/op
5
allocs/op5
allocs/op1
BenchmarkHasLinkWithPatternAndDomainPatternLarge
10174
ns/op 7600 B/op 111 allocs/op9946
ns/op 7586 B/op 111 allocs/op1.02
BenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op
10174
ns/op9946
ns/op1.02
BenchmarkHasLinkWithPatternAndDomainPatternLarge - B/op
7600
B/op7586
B/op1.00
BenchmarkHasLinkWithPatternAndDomainPatternLarge - allocs/op
111
allocs/op111
allocs/op1
This comment was automatically generated by workflow using github-action-benchmark.