Commit ccda4a5
fix(loki.source.file): Close file if we cannot find encoding [backport] (#5531)
## Backport of #5528
This PR backports #5528 to release/v1.13.
### Original PR Author
@kalleep
### Description
### Pull Request Details
Noticed that we do not close file if we cannot get encoding. Review all
other paths and we close file properly.
I really wish go had something like [errdefer like zig
does](https://ziglang.org/documentation/master/#errdefer).
### Issue(s) fixed by this Pull Request
<!--
Uncomment the following line and fill in an issue number if you want a
GitHub
issue to be closed automatically when this PR gets merged.
-->
<!-- Fixes #issue_id -->
### Notes to the Reviewer
<!-- Add any relevant notes for the reviewers and testers of this PR.
-->
### PR Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to
[x]. -->
- [ ] Documentation added
- [ ] Tests updated
- [ ] Config converters updated
---
*This backport was created automatically.*
Co-authored-by: Karl Persson <23356117+kalleep@users.noreply.github.com>1 parent 2f43c91 commit ccda4a5
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments