forked from forgejo/forgejo
Fix utf8 tests (#8192)
* Prevent compiler environment from making the tests fail * Remove unused function * Pass lint
This commit is contained in:
parent
73f7e82024
commit
2628b15ee3
2 changed files with 79 additions and 33 deletions
|
@ -35,7 +35,7 @@ func ToUTF8WithErr(content []byte) (string, error) {
|
|||
}
|
||||
|
||||
// If there is an error, we concatenate the nicely decoded part and the
|
||||
// original left over. This way we won't lose data.
|
||||
// original left over. This way we won't lose much data.
|
||||
result, n, err := transform.Bytes(encoding.NewDecoder(), content)
|
||||
if err != nil {
|
||||
result = append(result, content[n:]...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue