@@ -12,6 +12,7 @@ import (
1212 "github.com/golangci/golangci-lint/v2/pkg/goformatters/gofumpt"
1313 "github.com/golangci/golangci-lint/v2/pkg/goformatters/goimports"
1414 "github.com/golangci/golangci-lint/v2/pkg/goformatters/golines"
15+ "github.com/golangci/golangci-lint/v2/pkg/goformatters/swaggo"
1516 "github.com/golangci/golangci-lint/v2/pkg/logutils"
1617)
1718
@@ -41,6 +42,10 @@ func NewMetaFormatter(log logutils.Log, cfg *config.Formatters, runCfg *config.R
4142 m .formatters = append (m .formatters , goimports .New (& cfg .Settings .GoImports ))
4243 }
4344
45+ if slices .Contains (cfg .Enable , swaggo .Name ) {
46+ m .formatters = append (m .formatters , swaggo .New ())
47+ }
48+
4449 // gci is a last because the only goal of gci is to handle imports.
4550 if slices .Contains (cfg .Enable , gci .Name ) {
4651 formatter , err := gci .New (& cfg .Settings .Gci )
@@ -86,5 +91,5 @@ func (m *MetaFormatter) Format(filename string, src []byte) []byte {
8691}
8792
8893func IsFormatter (name string ) bool {
89- return slices .Contains ([]string {gofmt .Name , gofumpt .Name , goimports .Name , gci .Name , golines .Name }, name )
94+ return slices .Contains ([]string {gofmt .Name , gofumpt .Name , goimports .Name , gci .Name , golines .Name , swaggo . Name }, name )
9095}
0 commit comments