Skip to content

Commit ea5908d

Browse files
committed
fix: complexity
1 parent 24e4052 commit ea5908d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pkg/config/loader.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func (l *Loader) Load(opts LoadOptions) error {
6060
l.cfg.Linters.Exclusions.Generated = GeneratedModeStrict
6161
}
6262

63-
if l.cfg.GetConfigDir() != "" && l.cfg.Version != "2" {
64-
return fmt.Errorf("unsupported version of the configuration: %q (require configuration v2)", l.cfg.Version)
63+
err = l.checkConfigurationVersion()
64+
if err != nil {
65+
return err
6566
}
6667

6768
if !l.cfg.InternalCmdTest {
@@ -131,6 +132,14 @@ func (l *Loader) appendStringSlice(name string, current *[]string) {
131132
}
132133
}
133134

135+
func (l *Loader) checkConfigurationVersion() error {
136+
if l.cfg.GetConfigDir() != "" && l.cfg.Version != "2" {
137+
return fmt.Errorf("unsupported version of the configuration: %q (require configuration v2)", l.cfg.Version)
138+
}
139+
140+
return nil
141+
}
142+
134143
func (l *Loader) handleGoVersion() {
135144
if l.cfg.Run.Go == "" {
136145
l.cfg.Run.Go = detectGoVersion(context.Background())

0 commit comments

Comments
 (0)