4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 18:59:24 +00:00

Move golangci-lint configuration to file (#635)

This commit is contained in:
Duco van Amstel
2018-12-05 10:34:34 +00:00
committed by Wim
parent ce73aa5a74
commit 8a7efce941
3 changed files with 221 additions and 7 deletions

View File

@ -3,7 +3,6 @@ package birc
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"regexp"
"strconv"
@ -180,8 +179,6 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
rmsg.Text = re.ReplaceAllString(rmsg.Text, "")
// start detecting the charset
var r io.Reader
var err error
mycharset := b.GetString("Charset")
if mycharset == "" {
// detect what were sending so that we convert it to utf-8
@ -202,7 +199,7 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
case "gbk", "gb18030", "gb2312", "big5", "euc-kr", "euc-jp", "shift-jis", "iso-2022-jp":
rmsg.Text = ic.ConvertString("utf-8", b.GetString("Charset"), rmsg.Text)
default:
r, err = charset.NewReader(mycharset, strings.NewReader(rmsg.Text))
r, err := charset.NewReader(mycharset, strings.NewReader(rmsg.Text))
if err != nil {
b.Log.Errorf("charset to utf-8 conversion failed: %s", err)
return