{"id":15598656,"url":"https://github.com/jofaval/return-change-marchine","last_synced_at":"2026-06-29T03:31:07.296Z","repository":{"id":125618378,"uuid":"545675578","full_name":"jofaval/return-change-marchine","owner":"jofaval","description":"Golang Command Interface to compute the money return change given an amount, with some refactor","archived":false,"fork":false,"pushed_at":"2022-10-05T22:16:14.000Z","size":58,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-06T12:13:33.408Z","etag":null,"topics":["beginner-friendly","cash","change","change-return","go","golang","tdd","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jofaval.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-10-04T19:41:37.000Z","updated_at":"2023-03-07T08:06:56.000Z","dependencies_parsed_at":"2023-08-12T06:02:01.255Z","dependency_job_id":null,"html_url":"https://github.com/jofaval/return-change-marchine","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.05555555555555558,"last_synced_commit":"6ff0ec630038af42ed7f7fd31fe658403f449bee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jofaval/return-change-marchine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jofaval%2Freturn-change-marchine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jofaval%2Freturn-change-marchine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jofaval%2Freturn-change-marchine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jofaval%2Freturn-change-marchine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jofaval","download_url":"https://codeload.github.com/jofaval/return-change-marchine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jofaval%2Freturn-change-marchine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34912252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"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":["beginner-friendly","cash","change","change-return","go","golang","tdd","testing"],"created_at":"2024-10-03T01:40:55.161Z","updated_at":"2026-06-29T03:31:07.264Z","avatar_url":"https://github.com/jofaval.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Return Change Machine #\n\nA classic example of the machine that returns change optimizing the amount of elements it gives for a given amount\n\n## Contents\n\n1. [Using go](#using-go)\n1. [Problem](#problem)\n1. [Testing](#testing)\n1. [Credits](#credits)\n1. [TODO](#todo)\n\n## Using go\n\nI'm a beginner in Go, so I thought of using this example as practice. I'll be trying to apply some minor optimizations/refactor than what I usually did\n\n## Problem\n\nYou'll be given a numeric input of the amount that needs the return from.\\\nYou should output how much of each element (5x1 dolar bills, 10x50 dolar bills, 2x1 cents, etc.)\n\nThe least return the better solution, the less code and more readable, the finer.\n\n## Testing\n\nGiven it's a small example with predefined best solutions, it'd be nice to clearly identify the possibilities.\n\nTest Driven Development is a nice addition to this clear exercise.\n\n### Test with coverage\n\n```bash\ngo test -v -coverprofile=coverage.out ./...\ngo tool cover -html=coverage.out\n```\n\n## Credits\n\nTo my teacher (Pilar) from whom I learned this exercise.\\\nAnd to Chelo, a teacher that mentioned this as a technical challenge for some bussiness.\n\nTo this article [Golang Import Local Package](https://linuxhint.com/golang-import-local-package/) for explaining and providing helpful examples about import of local go packages.\n\n## TODO\n\n- [X] Complete the base exercise\n- [X] Use a map to compute the operations\n- [X] Implement an amount for the change\n  - [X] Implement a smart amount for the change, meaning, if we can supply change by using lower value currency, that's still considered a good solution\n- [X] Implement a (clearly defined) test set","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjofaval%2Freturn-change-marchine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjofaval%2Freturn-change-marchine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjofaval%2Freturn-change-marchine/lists"}