{"id":16932950,"url":"https://github.com/arp242/follow","last_synced_at":"2026-03-04T20:32:22.885Z","repository":{"id":57541356,"uuid":"282664397","full_name":"arp242/follow","owner":"arp242","description":"Go library to follow a file for changes; e.g. \"tail -F\".","archived":false,"fork":false,"pushed_at":"2024-05-22T23:26:19.000Z","size":1299,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T09:51:36.605Z","etag":null,"topics":["go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arp242.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"arp242"}},"created_at":"2020-07-26T14:16:29.000Z","updated_at":"2025-03-09T17:05:21.000Z","dependencies_parsed_at":"2024-06-18T21:25:02.462Z","dependency_job_id":"a4dade7c-bd49-4577-9fd5-c2bd372c0a35","html_url":"https://github.com/arp242/follow","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/arp242%2Ffollow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arp242%2Ffollow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arp242%2Ffollow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arp242%2Ffollow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arp242","download_url":"https://codeload.github.com/arp242/follow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243992459,"owners_count":20380208,"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":["go"],"created_at":"2024-10-13T20:48:07.093Z","updated_at":"2026-03-04T20:32:17.153Z","avatar_url":"https://github.com/arp242.png","language":"Go","funding_links":["https://github.com/sponsors/arp242"],"categories":[],"sub_categories":[],"readme":"Go library to follow a file for changes; e.g. \"tail -F\".\n\nThere's a little example application in [`tail/main.go`](/tail/main.go):\n\n```go\nfunc main() {\n\tif len(os.Args) \u003c= 1 {\n\t\tfmt.Println(\"need at least one filename\")\n\t\tos.Exit(1)\n\t}\n\n\tf := follow.New()\n\n\t// Maximum time to retry opening the file after it goes away; -1 to keep\n\t// trying forever.\n\tf.Retry = -1\n\n\t// Install signal handler; any signal sent to this will reopen the file; you\n\t// can send something manually with:\n\t//    f.Reopen \u003c- os.Interrupt\n\tsignal.Notify(f.Reopen, syscall.SIGHUP)\n\n\t// Keep reading data in the background, sending it to the f.Data channel.\n\tgo func() { log.Fatal(f.Start(context.Background(), os.Args[1])) }()\n\n\tfor {\n\t\tdata := \u003c-f.Data\n\t\tif data.Err != nil {\n\t\t\tif data.Err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlog.Fatal(data.Err)\n\t\t}\n\t\tfmt.Println(\"X\", data)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farp242%2Ffollow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farp242%2Ffollow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farp242%2Ffollow/lists"}