{"action":"created","issue":{"url":"https://api.github.com/repos/ejunjsh/gorest/issues/4","repository_url":"https://api.github.com/repos/ejunjsh/gorest","labels_url":"https://api.github.com/repos/ejunjsh/gorest/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ejunjsh/gorest/issues/4/comments","events_url":"https://api.github.com/repos/ejunjsh/gorest/issues/4/events","html_url":"https://github.com/ejunjsh/gorest/issues/4","id":262488639,"node_id":"MDU6SXNzdWUyNjI0ODg2Mzk=","number":4,"title":"有个问题麻烦请教下","user":{"login":"caiya","id":12036572,"node_id":"MDQ6VXNlcjEyMDM2NTcy","avatar_url":"https://avatars3.githubusercontent.com/u/12036572?v=4","gravatar_id":"","url":"https://api.github.com/users/caiya","html_url":"https://github.com/caiya","followers_url":"https://api.github.com/users/caiya/followers","following_url":"https://api.github.com/users/caiya/following{/other_user}","gists_url":"https://api.github.com/users/caiya/gists{/gist_id}","starred_url":"https://api.github.com/users/caiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caiya/subscriptions","organizations_url":"https://api.github.com/users/caiya/orgs","repos_url":"https://api.github.com/users/caiya/repos","events_url":"https://api.github.com/users/caiya/events{/privacy}","received_events_url":"https://api.github.com/users/caiya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-03T16:08:41Z","updated_at":"2018-07-13T06:34:32Z","closed_at":null,"author_association":"NONE","body":"看了下源码发现wrapper.go里面有定义HttpResponse struct，方法WriteString调用时使用了io.WriteString方法，但是该方法要求传入的是writter接口，本身HttpResponse struct并未实现writter接口吧，那怎么可以传入呢？（只是匿名内嵌了个http.ResponseWriter接口），楼主能具体讲下struct匿名内嵌interface吗"},"comment":{"url":"https://api.github.com/repos/ejunjsh/gorest/issues/comments/404740243","html_url":"https://github.com/ejunjsh/gorest/issues/4#issuecomment-404740243","issue_url":"https://api.github.com/repos/ejunjsh/gorest/issues/4","id":404740243,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDc0MDI0Mw==","user":{"login":"ejunjsh","id":22493186,"node_id":"MDQ6VXNlcjIyNDkzMTg2","avatar_url":"https://avatars1.githubusercontent.com/u/22493186?v=4","gravatar_id":"","url":"https://api.github.com/users/ejunjsh","html_url":"https://github.com/ejunjsh","followers_url":"https://api.github.com/users/ejunjsh/followers","following_url":"https://api.github.com/users/ejunjsh/following{/other_user}","gists_url":"https://api.github.com/users/ejunjsh/gists{/gist_id}","starred_url":"https://api.github.com/users/ejunjsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejunjsh/subscriptions","organizations_url":"https://api.github.com/users/ejunjsh/orgs","repos_url":"https://api.github.com/users/ejunjsh/repos","events_url":"https://api.github.com/users/ejunjsh/events{/privacy}","received_events_url":"https://api.github.com/users/ejunjsh/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T06:34:32Z","updated_at":"2018-07-13T06:34:32Z","author_association":"OWNER","body":"@caiya 现在才看到，我想你应该知道了，但还是说一下吧，go是在编译的时候就知道哪些是struct实现了哪些接口，内嵌http.ResponseWriter只是告诉编译器我是一个包装了http.ResponseWriter的strut，我拥有http.ResponseWriter的所有方法，这样，go就知道不用去care是否HttpResponse 有没有实现方法，被包装的http.ResponseWriter实现就行。我这样做的目的就是扩展http.ResponseWriter没有实现的方法而已，其实所有类型的东西，都是给编译器看的。"}}
{"actor":{"display_login":"ejunjsh"}}