Skip to content

Commit 17b7d91

Browse files
committed
dev: use encoding/xml instead of go-xmlfmt/xmlfmt
1 parent 0a42d36 commit 17b7d91

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ require (
4040
github.com/ghostiam/protogetter v0.3.8
4141
github.com/go-critic/go-critic v0.11.5
4242
github.com/go-viper/mapstructure/v2 v2.2.1
43-
github.com/go-xmlfmt/xmlfmt v1.1.2
4443
github.com/gofrs/flock v0.12.1
4544
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
4645
github.com/golangci/go-printf-func-name v0.1.0

go.sum

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/printers/checkstyle.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"io"
77
"sort"
88

9-
"github.com/go-xmlfmt/xmlfmt"
109
"golang.org/x/exp/maps"
1110

1211
"github.com/golangci/golangci-lint/pkg/result"
@@ -81,12 +80,12 @@ func (p Checkstyle) Print(issues []result.Issue) error {
8180
return out.Files[i].Name < out.Files[j].Name
8281
})
8382

84-
data, err := xml.Marshal(&out)
83+
data, err := xml.MarshalIndent(&out, "", " ")
8584
if err != nil {
8685
return err
8786
}
8887

89-
_, err = fmt.Fprintf(p.w, "%s%s\n", xml.Header, xmlfmt.FormatXML(string(data), "", " "))
88+
_, err = fmt.Fprintf(p.w, "%s\n%s\n", xml.Header, data)
9089
if err != nil {
9190
return err
9291
}

0 commit comments

Comments
 (0)