{"action":"created","issue":{"url":"https://api.github.com/repos/alanjds/grumpy/issues/60","repository_url":"https://api.github.com/repos/alanjds/grumpy","labels_url":"https://api.github.com/repos/alanjds/grumpy/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/alanjds/grumpy/issues/60/comments","events_url":"https://api.github.com/repos/alanjds/grumpy/issues/60/events","html_url":"https://github.com/alanjds/grumpy/issues/60","id":351841955,"node_id":"MDU6SXNzdWUzNTE4NDE5NTU=","number":60,"title":"Use python function as go function","user":{"login":"alanjds","id":155623,"node_id":"MDQ6VXNlcjE1NTYyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/155623?v=4","gravatar_id":"","url":"https://api.github.com/users/alanjds","html_url":"https://github.com/alanjds","followers_url":"https://api.github.com/users/alanjds/followers","following_url":"https://api.github.com/users/alanjds/following{/other_user}","gists_url":"https://api.github.com/users/alanjds/gists{/gist_id}","starred_url":"https://api.github.com/users/alanjds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanjds/subscriptions","organizations_url":"https://api.github.com/users/alanjds/orgs","repos_url":"https://api.github.com/users/alanjds/repos","events_url":"https://api.github.com/users/alanjds/events{/privacy}","received_events_url":"https://api.github.com/users/alanjds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-18T18:34:30Z","updated_at":"2018-08-18T18:34:33Z","closed_at":null,"author_association":"OWNER","body":"I'm trying to implement a simple HTTP server, but it seems I can't send a python function as a go function to HandleFunc.\r\n\r\n```python\r\nfrom __go__.net.http import ListenAndServe\r\nfrom __go__.githubcom.gorilla.mux import NewRouter\r\nfrom __go__.fmt import Fprintf\r\n\r\ndef HomeHandler(w, r):\r\n    Fprintf(w, \"Hello world\")\r\n\r\nr = NewRouter()\r\nr.HandleFunc(\"/\", HomeHandler)\r\nListenAndServe(\":8000\", r)\r\n```\r\n\r\nI'm receiving this error:\r\n\r\n```\r\n$ cat web.py | make run\r\nTypeError: cannot convert grumpy.Object to func(http.ResponseWriter, *http.Request)\r\nexit status 1\r\nmake: *** [run] Error 1\r\n```"},"comment":{"url":"https://api.github.com/repos/alanjds/grumpy/issues/comments/414077963","html_url":"https://github.com/alanjds/grumpy/issues/60#issuecomment-414077963","issue_url":"https://api.github.com/repos/alanjds/grumpy/issues/60","id":414077963,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDA3Nzk2Mw==","user":{"login":"alanjds","id":155623,"node_id":"MDQ6VXNlcjE1NTYyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/155623?v=4","gravatar_id":"","url":"https://api.github.com/users/alanjds","html_url":"https://github.com/alanjds","followers_url":"https://api.github.com/users/alanjds/followers","following_url":"https://api.github.com/users/alanjds/following{/other_user}","gists_url":"https://api.github.com/users/alanjds/gists{/gist_id}","starred_url":"https://api.github.com/users/alanjds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanjds/subscriptions","organizations_url":"https://api.github.com/users/alanjds/orgs","repos_url":"https://api.github.com/users/alanjds/repos","events_url":"https://api.github.com/users/alanjds/events{/privacy}","received_events_url":"https://api.github.com/users/alanjds/received_events","type":"User","site_admin":false},"created_at":"2018-08-18T18:34:33Z","updated_at":"2018-08-18T18:34:33Z","author_association":"OWNER","body":"<a href=\"https://github.com/S-YOU\"><img src=\"https://avatars1.githubusercontent.com/u/1001175?v=4\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [S-YOU](https://github.com/S-YOU)**\n_Thursday Jan 05, 2017 at 07:42 GMT_\n\n----\n\nI think the real issue is how to convert something(w, r) from python to func(http.ResponseWriter, *http.Request), you might need type annotations like python 3.6 does.\r\n\n"}}
{"actor":{"display_login":"alanjds"}}