Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support symlink file detect #5

Merged
merged 4 commits into from
Jan 10, 2025
Merged

feat: support symlink file detect #5

merged 4 commits into from
Jan 10, 2025

Conversation

luohoufu
Copy link
Contributor

@luohoufu luohoufu commented Jan 9, 2025

What does this PR do

support symlink file detect and fix symlink file nil check

Rationale for this change

This pull request includes several enhancements and bug fixes in the lib/reader/harvester/harvester.go, lib/util/file.go, and plugin/logs/file_detect.go files. The changes focus on improving error handling, removing unused code, and adding new utility functions.

Error handling improvements:

Code cleanup:

New utility functions:

  • lib/util/file.go: Added CountFileRows and ResolveSymlink functions to count the number of rows in a file and resolve the target file path of a symbolic link, respectively. [1] [2] [3]

Integration of new utility functions:

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@luohoufu luohoufu requested review from medcl and silenceqi January 9, 2025 02:29
@luohoufu luohoufu merged commit d8dcbda into main Jan 10, 2025
3 checks passed
@luohoufu luohoufu deleted the improve_pr branch January 10, 2025 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants