Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/goformatters/gci/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/daixiang0/gci/pkg/config"
"github.com/daixiang0/gci/pkg/section"
sectioni "github.com/golangci/golangci-lint/pkg/goformatters/gci/internal/section"
)

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

sections, err := section.Parse(g.SectionStrings)
sections, err := sectioni.Parse(g.SectionStrings)
if err != nil {
return nil, err
}
if sections == nil {
sections = section.DefaultSections()
sections = sectioni.DefaultSections()
}
if err := configureSections(sections, g.ModPath); err != nil {
return nil, err
Expand All @@ -63,7 +64,7 @@ func (g YamlConfig) Parse() (*Config, error) {
})
}

sectionSeparators, err := section.Parse(g.SectionSeparatorStrings)
sectionSeparators, err := sectioni.Parse(g.SectionSeparatorStrings)
if err != nil {
return nil, err
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/goformatters/gci/internal/section/section.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package section

import "github.com/daixiang0/gci/pkg/section"

func DefaultSections() section.SectionList {
return section.SectionList{Standard{}, section.Default{}}
}
16 changes: 16 additions & 0 deletions pkg/golinters/gci/testdata/gci_go124.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build go1.24

//golangcitest:args -Egci
//golangcitest:expected_exitcode 0
package testdata

import (
"crypto/sha3"
"errors"
"fmt"
)

func _() {
fmt.Print(errors.New("x"))
sha3.New224()
}
Loading