Skip to content

Commit 8f59629

Browse files
build(deps): bump github.com/go-critic/go-critic from 0.11.2 to 0.11.3 (#4619)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 7f70763 commit 8f59629

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require (
3838
github.com/firefart/nonamedreturns v1.0.4
3939
github.com/fzipp/gocyclo v0.6.0
4040
github.com/ghostiam/protogetter v0.3.5
41-
github.com/go-critic/go-critic v0.11.2
41+
github.com/go-critic/go-critic v0.11.3
4242
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1
4343
github.com/go-xmlfmt/xmlfmt v1.1.2
4444
github.com/gofrs/flock v0.8.1

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/printers/teamcity.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type InspectionType struct {
8989

9090
func (i InspectionType) Print(w io.Writer, escaper *strings.Replacer) (int, error) {
9191
return fmt.Fprintf(w, "##teamcity[inspectionType id='%s' name='%s' description='%s' category='%s']\n",
92-
limit(i.id, smallLimit), limit(i.name, smallLimit), limit(escaper.Replace(i.description), largeLimit), limit(i.category, smallLimit))
92+
cutVal(i.id, smallLimit), cutVal(i.name, smallLimit), cutVal(escaper.Replace(i.description), largeLimit), cutVal(i.category, smallLimit))
9393
}
9494

9595
// InspectionInstance reports a specific defect, warning, error message.
@@ -105,15 +105,15 @@ type InspectionInstance struct {
105105

106106
func (i InspectionInstance) Print(w io.Writer, replacer *strings.Replacer) (int, error) {
107107
return fmt.Fprintf(w, "##teamcity[inspection typeId='%s' message='%s' file='%s' line='%d' SEVERITY='%s']\n",
108-
limit(i.typeID, smallLimit),
109-
limit(replacer.Replace(i.message), largeLimit),
110-
limit(i.file, largeLimit),
108+
cutVal(i.typeID, smallLimit),
109+
cutVal(replacer.Replace(i.message), largeLimit),
110+
cutVal(i.file, largeLimit),
111111
i.line, strings.ToUpper(i.severity))
112112
}
113113

114-
func limit(s string, max int) string {
114+
func cutVal(s string, limit int) string {
115115
var size, count int
116-
for i := 0; i < max && count < len(s); i++ {
116+
for i := 0; i < limit && count < len(s); i++ {
117117
_, size = utf8.DecodeRuneInString(s[count:])
118118
count += size
119119
}

pkg/printers/teamcity_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestTeamCity_Print(t *testing.T) {
6666
assert.Equal(t, expected, buf.String())
6767
}
6868

69-
func TestTeamCity_limit(t *testing.T) {
69+
func TestTeamCity_cutVal(t *testing.T) {
7070
tests := []struct {
7171
input string
7272
max int
@@ -100,6 +100,6 @@ func TestTeamCity_limit(t *testing.T) {
100100
}
101101

102102
for _, tc := range tests {
103-
require.Equal(t, tc.expected, limit(tc.input, tc.max))
103+
require.Equal(t, tc.expected, cutVal(tc.input, tc.max))
104104
}
105105
}

0 commit comments

Comments
 (0)