{"id":21514534,"url":"https://github.com/jthomperoo/test-exec-command-golang","last_synced_at":"2025-04-09T20:04:44.536Z","repository":{"id":57549329,"uuid":"219608015","full_name":"jthomperoo/test-exec-command-golang","owner":"jthomperoo","description":"Example showing how to test exec.Command in Go","archived":false,"fork":false,"pushed_at":"2019-11-05T00:13:23.000Z","size":3,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:04:37.798Z","etag":null,"topics":["command","exec","go","golang","shell","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jthomperoo.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}},"created_at":"2019-11-04T22:22:55.000Z","updated_at":"2022-11-30T01:13:05.000Z","dependencies_parsed_at":"2022-08-27T00:40:25.960Z","dependency_job_id":null,"html_url":"https://github.com/jthomperoo/test-exec-command-golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Ftest-exec-command-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Ftest-exec-command-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Ftest-exec-command-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Ftest-exec-command-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jthomperoo","download_url":"https://codeload.github.com/jthomperoo/test-exec-command-golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103868,"owners_count":21048245,"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","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":["command","exec","go","golang","shell","unit-testing"],"created_at":"2024-11-23T23:51:47.627Z","updated_at":"2025-04-09T20:04:44.507Z","avatar_url":"https://github.com/jthomperoo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example repo of how to test exec.Command (and other system functions) in Golang\n\nAccompanies this article: [Unit-Testing-Exec-Command-In-Golang](https://jamiethompson.me/posts/Unit-Testing-Exec-Command-In-Golang/)\n\n## Overview\nPackage `funshell` contains the `ShellCommand` function which is being tested.  \n`ShellCommand` just kicks off the shell command `echo 'fun!'`.  \nThe `main` function in `main.go` just calls this, catches errors and then prints out anything that was output to stdout.  \nPackage `funshell_test` runs some simple unit tests against `ShellCommand`.  \n\n## Running\nRun the program with `go run main.go`.  \nRun the tests with `go test ./..`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjthomperoo%2Ftest-exec-command-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjthomperoo%2Ftest-exec-command-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjthomperoo%2Ftest-exec-command-golang/lists"}