Skip to content

Commit 0b862b7

Browse files
committed
gxi: fix section parsing
1 parent 5984eab commit 0b862b7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

pkg/goformatters/gci/internal/config/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/daixiang0/gci/pkg/config"
1010
"github.com/daixiang0/gci/pkg/section"
11+
sectioni "github.com/golangci/golangci-lint/pkg/goformatters/gci/internal/section"
1112
)
1213

1314
var defaultOrder = map[string]int{
@@ -39,12 +40,12 @@ type YamlConfig struct {
3940
func (g YamlConfig) Parse() (*Config, error) {
4041
var err error
4142

42-
sections, err := section.Parse(g.SectionStrings)
43+
sections, err := sectioni.Parse(g.SectionStrings)
4344
if err != nil {
4445
return nil, err
4546
}
4647
if sections == nil {
47-
sections = section.DefaultSections()
48+
sections = sectioni.DefaultSections()
4849
}
4950
if err := configureSections(sections, g.ModPath); err != nil {
5051
return nil, err
@@ -63,7 +64,7 @@ func (g YamlConfig) Parse() (*Config, error) {
6364
})
6465
}
6566

66-
sectionSeparators, err := section.Parse(g.SectionSeparatorStrings)
67+
sectionSeparators, err := sectioni.Parse(g.SectionSeparatorStrings)
6768
if err != nil {
6869
return nil, err
6970
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package section
2+
3+
import "github.com/daixiang0/gci/pkg/section"
4+
5+
func DefaultSections() section.SectionList {
6+
return section.SectionList{Standard{}, section.Default{}}
7+
}

0 commit comments

Comments
 (0)