diff --git a/pkg/config/config.go b/pkg/config/config.go index df326af..814201a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -64,10 +64,11 @@ func (g YamlConfig) Parse() (*Config, error) { sort.Slice(sections, func(i, j int) bool { sectionI, sectionJ := sections[i].Type(), sections[j].Type() - if strings.Compare(sectionI, sectionJ) == 0 && !g.Cfg.NoLexOrder { - return strings.Compare(sections[i].String(), sections[j].String()) < 0 + if g.Cfg.NoLexOrder || strings.Compare(sectionI, sectionJ) != 0 { + return defaultOrder[sectionI] < defaultOrder[sectionJ] } - return defaultOrder[sectionI] < defaultOrder[sectionJ] + + return strings.Compare(sections[i].String(), sections[j].String()) < 0 }) }