{"id":18073416,"url":"https://github.com/blakewilliams/go-reloader","last_synced_at":"2025-08-20T18:41:17.519Z","repository":{"id":199084882,"uuid":"702114105","full_name":"BlakeWilliams/go-reloader","owner":"BlakeWilliams","description":"A simple live-reloader package for Go.","archived":false,"fork":false,"pushed_at":"2023-11-19T18:57:18.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T01:41:23.323Z","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/BlakeWilliams.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}},"created_at":"2023-10-08T14:36:23.000Z","updated_at":"2023-10-24T05:56:05.000Z","dependencies_parsed_at":"2023-11-19T19:36:09.125Z","dependency_job_id":null,"html_url":"https://github.com/BlakeWilliams/go-reloader","commit_stats":null,"previous_names":["blakewilliams/go-reloader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlakeWilliams%2Fgo-reloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlakeWilliams%2Fgo-reloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlakeWilliams%2Fgo-reloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlakeWilliams%2Fgo-reloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlakeWilliams","download_url":"https://codeload.github.com/BlakeWilliams/go-reloader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378141,"owners_count":20929296,"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":"2024-10-31T10:06:53.136Z","updated_at":"2025-04-05T18:16:52.412Z","avatar_url":"https://github.com/BlakeWilliams.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-reloader\n\ngo-reloader is a simple implementation of Go live-reloading for development. It works by running a process that watches for changes in specified files and directories, and rebuilds + restarts the process when a change is detected.\n\nUnlike other live-reload implementations, go-reloader is configured and run in your application so that custom loggers, build implementations, file watchers, and other aspects of the live-reload process can be customized.\n\ngo-reloader is still a WIP but is usable in its current state. Improvements and contributions are welcome!\n\n## Usage\n\nThe example below shows how to use go-reloader to watch for changes in the `internal`, `pkg`, and `assets` directories, and restart the application when a change is detected. It uses a simple HTTP health check to determine when the application is ready to receive requests to prevent the proxy from sending requests to the application before it's ready.\n\n```go\nl := slog.New(slog.NewTextHandler(os.Stdout, \u0026slog.HandlerOptions{\n\tLevel: slog.LevelDebug,\n}))\n\nwatcher, err := reloader.NewWatcher(\n\t\"internal\",\n\t\"pkg\",\n\t\"assets\",\n)\n\nif err != nil {\n\tpanic(err)\n}\n\nappReloader := reloader.New(\n\treloader.NewBuilder(\n\t\t[]string{\"go\", \"build\", \"-o\", \"buzzword\", \"./cmd/app\"},\n\t\t[]string{\"./buzzword\", \"serve\"},\n\t\tl,\n\t\tfunc() bool {\n\t\t\tres, err := http.Get(\"http://localhost:8080/_status\")\n\t\t\tif err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif res.StatusCode != 200 {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\treturn true\n\t\t},\n\t),\n\twatcher,\n\tl,\n)\n\ngo func() {\n\terr := appReloader.ListenAndProxy(ctx, \":9000\", \":8080\")\n\tif err != nil \u0026\u0026 err != context.Canceled {\n\t\tpanic(err)\n\t}\n}()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakewilliams%2Fgo-reloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblakewilliams%2Fgo-reloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakewilliams%2Fgo-reloader/lists"}