{"action":"created","issue":{"url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/1","repository_url":"https://api.github.com/repos/quii/learn-go-with-tests","labels_url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/1/comments","events_url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/1/events","html_url":"https://github.com/quii/learn-go-with-tests/issues/1","id":301968246,"number":1,"title":"Skill: Dependency Injection of mocks","user":{"login":"therealplato","id":764725,"avatar_url":"https://avatars3.githubusercontent.com/u/764725?v=4","gravatar_id":"","url":"https://api.github.com/users/therealplato","html_url":"https://github.com/therealplato","followers_url":"https://api.github.com/users/therealplato/followers","following_url":"https://api.github.com/users/therealplato/following{/other_user}","gists_url":"https://api.github.com/users/therealplato/gists{/gist_id}","starred_url":"https://api.github.com/users/therealplato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealplato/subscriptions","organizations_url":"https://api.github.com/users/therealplato/orgs","repos_url":"https://api.github.com/users/therealplato/repos","events_url":"https://api.github.com/users/therealplato/events{/privacy}","received_events_url":"https://api.github.com/users/therealplato/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-03T04:40:50Z","updated_at":"2018-04-16T13:07:11Z","closed_at":"2018-04-16T13:07:11Z","author_association":"NONE","body":"It's common to test a piece of code that relies on some other type. You can instantiate a \"real\" version of the dependency and use it in the tests, but that may have costs - it may run slowly, return something different every time, or be complicated to configure. I prefer to use an interface to declare what the dependency does, so I can use a \"mock\" version of that type in the tests.\r\n\r\nFeel free to copy and/or modify http://therealplato.com/posts/soberoctober11/#quick-pattern-dependency-injection . May be worth providing examples both with and without `github.com/stretchr/testify/mock`"},"comment":{"url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/comments/381592749","html_url":"https://github.com/quii/learn-go-with-tests/issues/1#issuecomment-381592749","issue_url":"https://api.github.com/repos/quii/learn-go-with-tests/issues/1","id":381592749,"user":{"login":"quii","id":631756,"avatar_url":"https://avatars2.githubusercontent.com/u/631756?v=4","gravatar_id":"","url":"https://api.github.com/users/quii","html_url":"https://github.com/quii","followers_url":"https://api.github.com/users/quii/followers","following_url":"https://api.github.com/users/quii/following{/other_user}","gists_url":"https://api.github.com/users/quii/gists{/gist_id}","starred_url":"https://api.github.com/users/quii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quii/subscriptions","organizations_url":"https://api.github.com/users/quii/orgs","repos_url":"https://api.github.com/users/quii/repos","events_url":"https://api.github.com/users/quii/events{/privacy}","received_events_url":"https://api.github.com/users/quii/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T13:07:11Z","updated_at":"2018-04-16T13:07:11Z","author_association":"OWNER","body":"We've got chapters on mocking and DI now, so hurrah! "}}
{"actor":{"display_login":"quii"}}