Skip to content

Commit ba4b6df

Browse files
committed
dev: fix implementation
1 parent c5d4b0e commit ba4b6df

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pkg/golinters/gci/gci.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ func New(settings *config.GciSettings) *goanalysis.Linter {
7272
nil,
7373
).WithContextSetter(func(lintCtx *linter.Context) {
7474
analyzer.Run = func(pass *analysis.Pass) (any, error) {
75-
var err error
76-
cfg.Sections, err = hackSectionList(pass, cfg)
77-
if err != nil {
78-
return nil, err
79-
}
75+
cfg.Sections = hackSectionList(pass, cfg)
8076

8177
issues, err := runGci(pass, lintCtx, cfg, &lock)
8278
if err != nil {
@@ -154,7 +150,7 @@ func getIssuedTextGci(settings *config.LintersSettings) string {
154150
return text
155151
}
156152

157-
func hackSectionList(pass *analysis.Pass, cfg *gcicfg.Config) (section.SectionList, error) {
153+
func hackSectionList(pass *analysis.Pass, cfg *gcicfg.Config) section.SectionList {
158154
var sections section.SectionList
159155

160156
for _, sect := range cfg.Sections {
@@ -170,7 +166,7 @@ func hackSectionList(pass *analysis.Pass, cfg *gcicfg.Config) (section.SectionLi
170166
sections = append(sections, sect)
171167
}
172168

173-
return sections, nil
169+
return sections
174170
}
175171

176172
// diffFormattedFilesToArray is a copy of gci.DiffFormattedFilesToArray without io.StdInGenerator.

0 commit comments

Comments
 (0)