refactor: remove redundant err declarations (#32381)

(cherry picked from commit f4d3aaeeb9e1b11c5495e4608a3f52f316c35758)

Conflicts:
	- modules/charset/charset_test.go
	  Resolved by manually changing a `=` to `:=`, as per the
	  original patch. Conflict was due to `require.NoError`.
This commit is contained in:
Oleksandr Redko 2024-10-30 21:36:24 +02:00 committed by Gergely Nagy
parent 2a38208004
commit 4aa61601c3
No known key found for this signature in database
11 changed files with 3 additions and 20 deletions

View file

@ -41,14 +41,12 @@ func TestMaybeRemoveBOM(t *testing.T) {
func TestToUTF8(t *testing.T) {
resetDefaultCharsetsOrder()
var res string
var err error
// Note: golang compiler seems so behave differently depending on the current
// locale, so some conversions might behave differently. For that reason, we don't
// depend on particular conversions but in expected behaviors.
res, err = ToUTF8([]byte{0x41, 0x42, 0x43}, ConvertOpts{})
res, err := ToUTF8([]byte{0x41, 0x42, 0x43}, ConvertOpts{})
require.NoError(t, err)
assert.Equal(t, "ABC", res)