{"id":29151250,"url":"https://github.com/karpeleslab/runutil","last_synced_at":"2025-07-01T00:08:59.710Z","repository":{"id":57596730,"uuid":"376317928","full_name":"KarpelesLab/runutil","owner":"KarpelesLab","description":"Tools for running stuff in Go","archived":false,"fork":false,"pushed_at":"2024-03-14T09:40:10.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T00:08:56.027Z","etag":null,"topics":[],"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/KarpelesLab.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}},"created_at":"2021-06-12T15:01:37.000Z","updated_at":"2021-10-26T12:34:44.000Z","dependencies_parsed_at":"2024-03-14T10:25:11.732Z","dependency_job_id":null,"html_url":"https://github.com/KarpelesLab/runutil","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/KarpelesLab/runutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Frunutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Frunutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Frunutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Frunutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarpelesLab","download_url":"https://codeload.github.com/KarpelesLab/runutil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarpelesLab%2Frunutil/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262870877,"owners_count":23377314,"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":[],"created_at":"2025-07-01T00:08:55.568Z","updated_at":"2025-07-01T00:08:59.597Z","avatar_url":"https://github.com/KarpelesLab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/KarpelesLab/runutil?status.svg)](https://godoc.org/github.com/KarpelesLab/runutil)\n\n# runutil\n\nVarious useful tools for running and pipe-ing stuff outside of Go.\n\nThis library makes it very easy to execute complex sequences of executables mixing both go native methods like `gzip.NewReader` and UNIX commands in the way pipes work on bash/etc.\n\nFor example it is possible to run the following:\n\n```go\ncompressed, err := RunPipe(input, \"gzip\", \"-9\")\nif err != nil {\n\tt.Errorf(\"failed to run test: %s\", err)\n\treturn\n}\n\nres, err = gzip.NewReader(compressed)\nif err != nil {\n\tt.Errorf(\"failed to run test: %s\", err)\n\treturn\n}\n```\n\nReading from `res` in that example will return the exact same bytes as input, after having been compressed once (into `compressed`), then decompressed.\n\nIf the command fails, the final Read() call will return the failure code, and allows correctly catching any problem (by default, go `os/exec` will only return the error when calling Wait(), which may result in errors not being catched).\n\n## Help\n\n### There are a lot of zombie threads\n\nThis means Wait() was not called. If using a method returning a pipe, you need to read the pipe to EOF in order for resources to be cleared. Another option is to call `defer pipe.Close()` in order to ensure resources are freed.\n\nClose() will return quickly and kill the process, however if you want to wait and give the process some time, `defer pipe.CloseWait(ctx)` can be used. If the context has a deadline the process will be killed as per the deadline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarpeleslab%2Frunutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarpeleslab%2Frunutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarpeleslab%2Frunutil/lists"}