Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
feat: trim whitechars for file with multiline
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Jul 6, 2021
1 parent 8b99134 commit 5538de5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion operator/builtin/input/file/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"go.uber.org/zap"
"golang.org/x/text/encoding"
Expand Down Expand Up @@ -198,7 +199,7 @@ func (r *Reader) decode(msgBuf []byte) (string, error) {
} else if err != nil {
return "", fmt.Errorf("transform encoding: %s", err)
}
return string(r.decodeBuffer[:nDst]), nil
return strings.TrimRight(string(r.decodeBuffer[:nDst]), "\r\t \n"), nil
}
}

Expand Down

0 comments on commit 5538de5

Please sign in to comment.