{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/8869","labels_url":"https://api.github.com/repos/golang/go/issues/8869/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/8869/comments","events_url":"https://api.github.com/repos/golang/go/issues/8869/events","html_url":"https://github.com/golang/go/issues/8869","id":51288807,"number":8869,"title":"time: mockable time support","user":{"login":"jmhodges","id":598,"avatar_url":"https://avatars.githubusercontent.com/u/598?v=3","gravatar_id":"","url":"https://api.github.com/users/jmhodges","html_url":"https://github.com/jmhodges","followers_url":"https://api.github.com/users/jmhodges/followers","following_url":"https://api.github.com/users/jmhodges/following{/other_user}","gists_url":"https://api.github.com/users/jmhodges/gists{/gist_id}","starred_url":"https://api.github.com/users/jmhodges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmhodges/subscriptions","organizations_url":"https://api.github.com/users/jmhodges/orgs","repos_url":"https://api.github.com/users/jmhodges/repos","events_url":"https://api.github.com/users/jmhodges/events{/privacy}","received_events_url":"https://api.github.com/users/jmhodges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1036,"closed_issues":82,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2015-08-30T18:01:20Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":5,"created_at":"2014-10-05T00:25:49Z","updated_at":"2015-09-02T02:36:18Z","closed_at":null,"body":"<pre>With github.com/jmhodges/clock and the broader <a href=\"https://github.com/benbjohnson/clock\">https://github.com/benbjohnson/clock</a> API,\nthere's a desire for the timing systems in Go to be fakeable[1]. Using a fake clock\ninstead of time.Now directly is useful when testing code that stores timestamps, caches\ndata, etc.\n\nThe benbjohnson clock package attempts to make Ticker and Timer calls (as well as their\nrelated AfterFunc and Sleep methods) work against a fake time that can be set and\nupdated in tests. However, it relies on some micro-sleeps and runtime.Gosched calls that\nare obviously going to be flaky. But there is a desire to able to test code that uses\nTickers and Timers, not by adjusting the durations they work for (which can induce flaky\ntesting), but by adjusting when they think they need to wake up.\n\nTo do that, we seem to need more runtime magic to help developers out. In fact, it might\nbe best if a clock package like these lived in the stdlib so that it could be tied more\ncarefully and thoughtfully to the scheduler.\n\n [1] or &quot;mockable&quot;, whatever language you prefer. The summary of this issue is to distinguish it from <a href=\"https://golang.org/issue/5356\">issue #5356</a>.</pre>"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/136917110","html_url":"https://github.com/golang/go/issues/8869#issuecomment-136917110","issue_url":"https://api.github.com/repos/golang/go/issues/8869","id":136917110,"user":{"login":"jmhodges","id":598,"avatar_url":"https://avatars.githubusercontent.com/u/598?v=3","gravatar_id":"","url":"https://api.github.com/users/jmhodges","html_url":"https://github.com/jmhodges","followers_url":"https://api.github.com/users/jmhodges/followers","following_url":"https://api.github.com/users/jmhodges/following{/other_user}","gists_url":"https://api.github.com/users/jmhodges/gists{/gist_id}","starred_url":"https://api.github.com/users/jmhodges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmhodges/subscriptions","organizations_url":"https://api.github.com/users/jmhodges/orgs","repos_url":"https://api.github.com/users/jmhodges/repos","events_url":"https://api.github.com/users/jmhodges/events{/privacy}","received_events_url":"https://api.github.com/users/jmhodges/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T02:36:18Z","updated_at":"2015-09-02T02:36:18Z","body":"Any chance of something happening for this?"}}