4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-03 11:57:45 +00:00

Update dependencies (#1822)

This commit is contained in:
Wim
2022-05-02 00:10:54 +02:00
committed by GitHub
parent 888c8b9a84
commit 81e6f75aa4
54 changed files with 640 additions and 232 deletions

View File

@ -28,6 +28,7 @@ linters-settings:
gocritic:
disabled-checks:
- hugeParam
- ifElseChain
enabled-tags:
- diagnostic
- opinionated

View File

@ -52,7 +52,7 @@ func ParseEvent(raw string) (e *Event) {
i = 0
}
if raw[0] == messagePrefix {
if raw != "" && raw[0] == messagePrefix {
// Prefix ends with a space.
i = strings.IndexByte(raw, eventSpace)
@ -297,7 +297,9 @@ func (e *Event) Bytes() []byte {
buffer.Truncate(maxLength)
}
out := buffer.Bytes()
// If we truncated in the middle of a utf8 character, we need to remove
// the other (now invalid) bytes.
out := bytes.ToValidUTF8(buffer.Bytes(), nil)
// Strip newlines and carriage returns.
for i := 0; i < len(out); i++ {