{"id":20731552,"url":"https://github.com/datumbrain/training-ut-util-go","last_synced_at":"2026-03-14T02:10:47.797Z","repository":{"id":247353469,"uuid":"822444600","full_name":"datumbrain/training-ut-util-go","owner":"datumbrain","description":"Utility (merger) implementation in Go.","archived":false,"fork":false,"pushed_at":"2024-07-09T08:20:04.000Z","size":9,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T16:04:17.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datumbrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-01T07:03:37.000Z","updated_at":"2024-07-03T07:15:36.000Z","dependencies_parsed_at":"2024-07-09T15:45:45.223Z","dependency_job_id":null,"html_url":"https://github.com/datumbrain/training-ut-util-go","commit_stats":null,"previous_names":["datumbrain/training-ut-util-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datumbrain/training-ut-util-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Ftraining-ut-util-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Ftraining-ut-util-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Ftraining-ut-util-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Ftraining-ut-util-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datumbrain","download_url":"https://codeload.github.com/datumbrain/training-ut-util-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Ftraining-ut-util-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T05:15:47.126Z","updated_at":"2025-12-24T02:19:30.606Z","avatar_url":"https://github.com/datumbrain.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utility\n\nThis repository contains a Go CLI that performs file merging operations. The CLI merges all JSONL files in a specified directory into a single JSONL file and stores it in an output directory. Additionally, if the --format csv flag is used, the output is a CSV file.\n\n## Task Description\n\n**Objective:** Create a Go CLI tool named `util` that performs file merging operations. The tool should merge all JSONL files in a specified directory into a single JSONL file and store it in an output directory. Additionally, if the `--format csv` flag is used, the output should be a CSV file.\n\n## Requirements\n\n1. **CLI Flags:**\n\n   - `--operation merge`: Specifies the operation to be performed.\n   - `--input-path ./\u003cany_path\u003e`: Path to the directory containing JSONL files to be merged.\n   - `--output-path ./\u003cany_path\u003e`: Path to the directory where the merged file will be stored.\n   - `--format csv`: (Optional) If provided, the output should be a CSV file instead of a JSONL file.\n\n2. **Functionality:**\n\n   - Read all JSONL files from the input directory.\n   - Merge the content of all JSONL files into a single JSONL file.\n   - If the `--format csv` flag is detected, convert the merged JSONL content to CSV format.\n   - Save the merged file (in JSONL or CSV format) to the specified output directory.\n\n3. **Bonus:** Implement the `--format csv` flag to output a CSV file.\n\n## Steps to Complete the Task\n\n1. **Setup Go Environment:**\n\n   - Ensure Go is installed on your machine.\n   - Create a new Go module.\n\n2. **Implement the CLI Tool:**\n\n   - Use a CLI package like `flag` or `cobra` for parsing command-line arguments.\n   - Implement functions to read and merge JSONL files.\n   - Implement functions to convert JSONL to CSV format (if required).\n   - Implement the main function to handle CLI arguments and execute the appropriate functions.\n\n3. **Testing:**\n\n   - Create a few sample JSONL files for testing.\n   - Test the tool by running the command with different flag combinations.\n\n4. **Documentation:**\n   - Provide clear instructions on how to use the tool, including examples.\n\n## Example Commands\n\n1. Merge JSONL files into a single JSONL file:\n\n   ```bash\n   ./bin/util --operation merge --input-path ./data/jsonl_files/ --output-path ./output_data\n   ```\n\n2. Merge JSONL files and output as a CSV file:\n\n   ```bash\n   ./bin/util --operation merge --input-path ./data/jsonl_files/ --output-path ./output_data --format csv\n   ```\n\n## Submission\n\nSubmit the following:\n\n1. The complete Go code.\n2. Sample input JSONL files for testing.\n3. A README file with instructions on how to build and run the tool, including example commands.\n\nGood luck with the task!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatumbrain%2Ftraining-ut-util-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatumbrain%2Ftraining-ut-util-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatumbrain%2Ftraining-ut-util-go/lists"}