File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2253,6 +2253,12 @@ linters:
22532253 # Enable/disable optimization of hex formatting.
22542254 # Default: true
22552255 hex-format : false
2256+ # Enable/disable optimization of concat loop.
2257+ # Default: true
2258+ concat-loop : false
2259+ # Optimization of `concat-loop` even with other operations.
2260+ # Default: false
2261+ loop-other-ops : true
22562262
22572263 prealloc :
22582264 # IMPORTANT: we don't recommend using this linter before doing performance profiling.
Original file line number Diff line number Diff line change 30043004 "description" : " Enable/disable optimization of hex formatting." ,
30053005 "type" : " boolean" ,
30063006 "default" : true
3007+ },
3008+ "concat-loop" : {
3009+ "description" : " Enable/disable optimization of concat loop." ,
3010+ "type" : " boolean" ,
3011+ "default" : true
3012+ },
3013+ "loop-other-ops" : {
3014+ "description" : " Optimization of `concat-loop` even with other operations." ,
3015+ "type" : " boolean" ,
3016+ "default" : false
30073017 }
30083018 }
30093019 },
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ var defaultLintersSettings = LintersSettings{
131131 StrConcat : true ,
132132 BoolFormat : true ,
133133 HexFormat : true ,
134+ ConcatLoop : true ,
134135 },
135136 Prealloc : PreallocSettings {
136137 Simple : true ,
@@ -794,6 +795,9 @@ type PerfSprintSettings struct {
794795
795796 BoolFormat bool `mapstructure:"bool-format"`
796797 HexFormat bool `mapstructure:"hex-format"`
798+
799+ ConcatLoop bool `mapstructure:"concat-loop"`
800+ LoopOtherOps bool `mapstructure:"loop-other-ops"`
797801}
798802
799803type PreallocSettings struct {
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ func New(settings *config.PerfSprintSettings) *goanalysis.Linter {
2828
2929 cfg ["bool-format" ] = settings .BoolFormat
3030 cfg ["hex-format" ] = settings .HexFormat
31+
32+ cfg ["concat-loop" ] = settings .ConcatLoop
33+ cfg ["loop-other-ops" ] = settings .LoopOtherOps
3134 }
3235
3336 return goanalysis .
You can’t perform that action at this time.
0 commit comments