{"action":"created","issue":{"url":"https://api.github.com/repos/hpcloud/tail/issues/69","labels_url":"https://api.github.com/repos/hpcloud/tail/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/hpcloud/tail/issues/69/comments","events_url":"https://api.github.com/repos/hpcloud/tail/issues/69/events","html_url":"https://github.com/hpcloud/tail/pull/69","id":121180257,"number":69,"title":"fix block until exists function","user":{"login":"miraclesu","id":682907,"avatar_url":"https://avatars.githubusercontent.com/u/682907?v=3","gravatar_id":"","url":"https://api.github.com/users/miraclesu","html_url":"https://github.com/miraclesu","followers_url":"https://api.github.com/users/miraclesu/followers","following_url":"https://api.github.com/users/miraclesu/following{/other_user}","gists_url":"https://api.github.com/users/miraclesu/gists{/gist_id}","starred_url":"https://api.github.com/users/miraclesu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miraclesu/subscriptions","organizations_url":"https://api.github.com/users/miraclesu/orgs","repos_url":"https://api.github.com/users/miraclesu/repos","events_url":"https://api.github.com/users/miraclesu/events{/privacy}","received_events_url":"https://api.github.com/users/miraclesu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-09T07:37:30Z","updated_at":"2015-12-14T02:46:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hpcloud/tail/pulls/69","html_url":"https://github.com/hpcloud/tail/pull/69","diff_url":"https://github.com/hpcloud/tail/pull/69.diff","patch_url":"https://github.com/hpcloud/tail/pull/69.patch"},"body":"When we run the flow program, then execute `echo hello > 0` in shell, there is nothing output. The expect output is `name=0 line=hello`.\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"strconv\"\r\n\t\"sync\"\r\n\r\n\t\"github.com/hpcloud/tail\"\r\n)\r\n\r\nfunc main() {\r\n\tcount := 2\r\n\twg := new(sync.WaitGroup)\r\n\tfor i := 0; i < count; i++ {\r\n\t\twg.Add(1)\r\n\t\tgo start(strconv.Itoa(i), wg)\r\n\t}\r\n\twg.Wait()\r\n}\r\n\r\nfunc start(name string, wg *sync.WaitGroup) {\r\n\tdefer wg.Done()\r\n\tt, err := tail.TailFile(name, tail.Config{\r\n\t\tFollow:    true,\r\n\t\tMustExist: false,\r\n\t})\r\n\r\n\tif err != nil {\r\n\t\tfmt.Printf(\"err=%+v\\n\", err)\r\n\t\treturn\r\n\t}\r\n\r\n\tfor {\r\n\t\tselect {\r\n\t\tcase line, ok := <-t.Lines:\r\n\t\t\tif !ok {\r\n\t\t\t\tfmt.Printf(\"name=%s exit, ok=%v\\n\", name, ok)\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tfmt.Printf(\"name=%s line=%s\\n\", name, line.Text)\r\n\t\t}\r\n\t}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/hpcloud/tail/issues/comments/164327076","html_url":"https://github.com/hpcloud/tail/pull/69#issuecomment-164327076","issue_url":"https://api.github.com/repos/hpcloud/tail/issues/69","id":164327076,"user":{"login":"miraclesu","id":682907,"avatar_url":"https://avatars.githubusercontent.com/u/682907?v=3","gravatar_id":"","url":"https://api.github.com/users/miraclesu","html_url":"https://github.com/miraclesu","followers_url":"https://api.github.com/users/miraclesu/followers","following_url":"https://api.github.com/users/miraclesu/following{/other_user}","gists_url":"https://api.github.com/users/miraclesu/gists{/gist_id}","starred_url":"https://api.github.com/users/miraclesu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miraclesu/subscriptions","organizations_url":"https://api.github.com/users/miraclesu/orgs","repos_url":"https://api.github.com/users/miraclesu/repos","events_url":"https://api.github.com/users/miraclesu/events{/privacy}","received_events_url":"https://api.github.com/users/miraclesu/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T02:46:51Z","updated_at":"2015-12-14T02:46:51Z","body":"@Nino-K Do you have a moment to review this PR?"}}