@@ -12,6 +12,7 @@ import (
12
12
"github.com/golangci/golangci-lint/v2/pkg/goformatters/gofumpt"
13
13
"github.com/golangci/golangci-lint/v2/pkg/goformatters/goimports"
14
14
"github.com/golangci/golangci-lint/v2/pkg/goformatters/golines"
15
+ "github.com/golangci/golangci-lint/v2/pkg/goformatters/swaggo"
15
16
"github.com/golangci/golangci-lint/v2/pkg/logutils"
16
17
)
17
18
@@ -41,6 +42,10 @@ func NewMetaFormatter(log logutils.Log, cfg *config.Formatters, runCfg *config.R
41
42
m .formatters = append (m .formatters , goimports .New (& cfg .Settings .GoImports ))
42
43
}
43
44
45
+ if slices .Contains (cfg .Enable , swaggo .Name ) {
46
+ m .formatters = append (m .formatters , swaggo .New ())
47
+ }
48
+
44
49
// gci is a last because the only goal of gci is to handle imports.
45
50
if slices .Contains (cfg .Enable , gci .Name ) {
46
51
formatter , err := gci .New (& cfg .Settings .Gci )
@@ -86,5 +91,5 @@ func (m *MetaFormatter) Format(filename string, src []byte) []byte {
86
91
}
87
92
88
93
func 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 )
90
95
}
0 commit comments