feat(clipper): Implement concurrent file reading and refactor project structure#34
Merged
feat(clipper): Implement concurrent file reading and refactor project structure#34
Conversation
…tines and channels Added new package `cli/reader/reader.go` to handle file and stdin content reading using goroutines and channels. Includes `ReadContentConcurrently` function to improve performance when handling multiple files. Issue #23
…tent reading Refactored `cli/clipper/clipper.go` to utilize functionalities from `cli/reader/reader.go` package. This change improves code readability and separates concerns for content reading operations.
…and constants Introduced `tests/tests.go` to hold helper functions and constants used across test cases, improving organization and reusability of testing resources.
…/clipper/clipper.go` tests Reorganized `tests/clipper/clipper_test.go` to focus exclusively on testing functionalities within `cli/clipper/clipper.go`, ensuring clear and specific test coverage.
…ader.go` tests Introduced `tests/reader/reader_test.go` to contain tests exclusively targeting functionalities within `cli/reader/reader.go`. Enhances clarity and maintainability of test cases related to content reading operations.
ccoVeille
reviewed
Jun 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enhances Clipper by introducing concurrent file reading using goroutines and channels in the new
cli/reader/reader.gopackage. It refactorscli/clipper/clipper.goto utilize these improvements, improving performance and maintainability. The test structure is also reorganized for clarity.Changes
New
cli/reader/reader.goPackage:ReadContentConcurrentlyfunction for efficient file handling.Refactored
cli/clipper/clipper.go:cli/reader/reader.gofor file reading operations.Enhanced Test Structure:
tests/tests.gofor shared testing utilities.tests/clipper/clipper_test.goandtests/reader/reader_test.go.Tasks
cli/reader/reader.go.cli/clipper/clipper.gofor improved readability and performance.Next Steps
Upon merging, focus will shift to benchmarking the application to quantify performance gains from concurrent file reading. This will inform future optimizations and enhancements to Clipper's file handling capabilities.
Closes #23