{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/17821","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/17821/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/17821/comments","events_url":"https://api.github.com/repos/golang/go/issues/17821/events","html_url":"https://github.com/golang/go/issues/17821","id":187571207,"number":17821,"title":"plugin: initializers not run on plugin load","user":{"login":"captncraig","id":192540,"avatar_url":"https://avatars.githubusercontent.com/u/192540?v=3","gravatar_id":"","url":"https://api.github.com/users/captncraig","html_url":"https://github.com/captncraig","followers_url":"https://api.github.com/users/captncraig/followers","following_url":"https://api.github.com/users/captncraig/following{/other_user}","gists_url":"https://api.github.com/users/captncraig/gists{/gist_id}","starred_url":"https://api.github.com/users/captncraig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/captncraig/subscriptions","organizations_url":"https://api.github.com/users/captncraig/orgs","repos_url":"https://api.github.com/users/captncraig/repos","events_url":"https://api.github.com/users/captncraig/events{/privacy}","received_events_url":"https://api.github.com/users/captncraig/received_events","type":"User","site_admin":false},"labels":[{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"crawshaw","id":161319,"avatar_url":"https://avatars.githubusercontent.com/u/161319?v=3","gravatar_id":"","url":"https://api.github.com/users/crawshaw","html_url":"https://github.com/crawshaw","followers_url":"https://api.github.com/users/crawshaw/followers","following_url":"https://api.github.com/users/crawshaw/following{/other_user}","gists_url":"https://api.github.com/users/crawshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/crawshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawshaw/subscriptions","organizations_url":"https://api.github.com/users/crawshaw/orgs","repos_url":"https://api.github.com/users/crawshaw/repos","events_url":"https://api.github.com/users/crawshaw/events{/privacy}","received_events_url":"https://api.github.com/users/crawshaw/received_events","type":"User","site_admin":false},"assignees":[{"login":"crawshaw","id":161319,"avatar_url":"https://avatars.githubusercontent.com/u/161319?v=3","gravatar_id":"","url":"https://api.github.com/users/crawshaw","html_url":"https://github.com/crawshaw","followers_url":"https://api.github.com/users/crawshaw/followers","following_url":"https://api.github.com/users/crawshaw/following{/other_user}","gists_url":"https://api.github.com/users/crawshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/crawshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawshaw/subscriptions","organizations_url":"https://api.github.com/users/crawshaw/orgs","repos_url":"https://api.github.com/users/crawshaw/repos","events_url":"https://api.github.com/users/crawshaw/events{/privacy}","received_events_url":"https://api.github.com/users/crawshaw/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/38","html_url":"https://github.com/golang/go/milestones/Go1.8","labels_url":"https://api.github.com/repos/golang/go/milestones/38/labels","id":1709363,"number":38,"title":"Go1.8","description":"","creator":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"open_issues":137,"closed_issues":572,"state":"open","created_at":"2016-04-15T16:30:23Z","updated_at":"2016-11-08T18:04:00Z","due_on":"2017-01-31T00:00:00Z","closed_at":null},"comments":14,"created_at":"2016-11-06T16:17:35Z","updated_at":"2016-11-08T19:05:16Z","closed_at":null,"body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n### What version of Go are you using (`go version`)?\r\nTip: `go version devel +2b445c7 Sat Nov 5 23:59:04 2016 +0000 darwin/amd64`\r\n\r\n### What did you do?\r\nPlugin package built with `go build -buildmode=plugin`:\r\n```\r\npackage main\r\n\r\nfunc init() {\r\n\tprint(\"INIT!\")\r\n}\r\n\r\nfunc main() {\r\n\tprint(\"MAIN\")\r\n}\r\n\r\nfunc F() {\r\n\tprint(\"F\")\r\n}\r\n```\r\n\r\nHost App:\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"plugin\"\r\n)\r\n\r\nfunc main() {\r\n\tfmt.Println(\"HOST\")\r\n\tp, err := plugin.Open(\"plugin.so\")\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tfmt.Println(p)\r\n\tf, err := p.Lookup(\"F\")\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tfmt.Println(f)\r\n\tf.(func())()\r\n\tselect {}\r\n}\r\n```\r\n\r\n### What did you expect to see?\r\nI expected to see the `INIT!` line from the plugin init printed as per the [docs](https://tip.golang.org/pkg/plugin/). Instead, that line seems to be missing. Full output:\r\n```\r\nHOST\r\n&{github.com/captncraig/scratch/testmain/plug 0xc420074060 map[F:0x6041800]}\r\n0x6041800\r\nF\r\n```\r\n\r\nAm I misreading how plugin loading works, or is it not working as intended?\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/259228376","html_url":"https://github.com/golang/go/issues/17821#issuecomment-259228376","issue_url":"https://api.github.com/repos/golang/go/issues/17821","id":259228376,"user":{"login":"gopherbot","id":8566911,"avatar_url":"https://avatars.githubusercontent.com/u/8566911?v=3","gravatar_id":"","url":"https://api.github.com/users/gopherbot","html_url":"https://github.com/gopherbot","followers_url":"https://api.github.com/users/gopherbot/followers","following_url":"https://api.github.com/users/gopherbot/following{/other_user}","gists_url":"https://api.github.com/users/gopherbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gopherbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopherbot/subscriptions","organizations_url":"https://api.github.com/users/gopherbot/orgs","repos_url":"https://api.github.com/users/gopherbot/repos","events_url":"https://api.github.com/users/gopherbot/events{/privacy}","received_events_url":"https://api.github.com/users/gopherbot/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T19:05:16Z","updated_at":"2016-11-08T19:05:16Z","body":"CL https://golang.org/cl/32916 mentions this issue."}}
{"actor":{"display_login":"gopherbot"}}