{"id":13714180,"url":"https://github.com/mxssl/topn","last_synced_at":"2025-07-30T03:04:50.371Z","repository":{"id":96800758,"uuid":"243645125","full_name":"mxssl/topn","owner":"mxssl","description":"Go implementation of topn app that finds top N numbers in a file","archived":false,"fork":false,"pushed_at":"2020-02-28T01:06:34.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T06:44:35.110Z","etag":null,"topics":["go","golang","test-task","topn"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mxssl.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":"2020-02-28T00:28:01.000Z","updated_at":"2021-09-04T06:49:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"879d9596-6118-4aa9-b0ed-d3824bbb70e6","html_url":"https://github.com/mxssl/topn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mxssl/topn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Ftopn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Ftopn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Ftopn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Ftopn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxssl","download_url":"https://codeload.github.com/mxssl/topn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Ftopn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267802719,"owners_count":24146504,"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-07-30T02:00:09.044Z","response_time":70,"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":["go","golang","test-task","topn"],"created_at":"2024-08-02T23:01:54.133Z","updated_at":"2025-07-30T03:04:50.306Z","avatar_url":"https://github.com/mxssl.png","language":"Go","readme":"# topn\n\ntopn finds top N numbers in a file\n\n## Task\n\nWrite a program, topN, that given an arbitrarily large file and a number, N, containing individual numbers on each line (e.g. 200Gb file), will output the largest N numbers, highest first.\n\n## Install\n\n- [Install go](https://golang.org/dl/)\n- `make build`\n\n## Usage\n\n### Generate file\n\n`topn generate --lines N --name filename` - generate `file` with `N` lines of random numbers.\n\n### Find the top N of largest numbers\n\n`topn run --file filename --top N`\n\n### Example\n\n- Generate file `numbers.txt` with `1000` lines of random numbers\n\n```sh\n./topn generate --name numbers.txt --lines 1000\nFile numbers.txt with 1000 lines of random numbers was successfully generated!\n```\n\n- Find top 5 largest numbers in file `numbers.txt`\n\n```sh\n./topn run --file numbers.txt --top 5\n[9219151525891662339 9215619702456294450 9207997407084704522 9207450753580197605 9173624551887931713]\n```\n\n## Test\n\n```sh\ngo test -cover -v ./...\n?   \tgithub.com/mxssl/topn\t[no test files]\n=== RUN   TestCase1\nexpected:  [100 90 80 70 60]\noutput:  [100 90 80 70 60]\n--- PASS: TestCase1 (0.00s)\nPASS\ncoverage: 42.3% of statements\nok  \tgithub.com/mxssl/topn/cmd\t0.260s\tcoverage: 42.3% of statements\n```\n","funding_links":[],"categories":["Repositories"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxssl%2Ftopn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxssl%2Ftopn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxssl%2Ftopn/lists"}