{"action":"created","issue":{"url":"https://api.github.com/repos/domokit/mojo/issues/469","labels_url":"https://api.github.com/repos/domokit/mojo/issues/469/labels{/name}","comments_url":"https://api.github.com/repos/domokit/mojo/issues/469/comments","events_url":"https://api.github.com/repos/domokit/mojo/issues/469/events","html_url":"https://github.com/domokit/mojo/issues/469","id":110351504,"number":469,"title":"Top-level constants are not generated in Go","user":{"login":"afandria","id":2432033,"avatar_url":"https://avatars.githubusercontent.com/u/2432033?v=3","gravatar_id":"","url":"https://api.github.com/users/afandria","html_url":"https://github.com/afandria","followers_url":"https://api.github.com/users/afandria/followers","following_url":"https://api.github.com/users/afandria/following{/other_user}","gists_url":"https://api.github.com/users/afandria/gists{/gist_id}","starred_url":"https://api.github.com/users/afandria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afandria/subscriptions","organizations_url":"https://api.github.com/users/afandria/orgs","repos_url":"https://api.github.com/users/afandria/repos","events_url":"https://api.github.com/users/afandria/events{/privacy}","received_events_url":"https://api.github.com/users/afandria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-08T00:55:09Z","updated_at":"2015-10-08T01:30:20Z","closed_at":null,"body":"Top-level constants defined in a .mojom file are not generated in Go.\r\n\r\nI have looked at the source.tmpl files and it looks like only struct/union/interface/enum are defined. The constants may be introduced if they are internal to a struct/union/interface/enum, but top-level ones are definitely not generated."},"comment":{"url":"https://api.github.com/repos/domokit/mojo/issues/comments/146388894","html_url":"https://github.com/domokit/mojo/issues/469#issuecomment-146388894","issue_url":"https://api.github.com/repos/domokit/mojo/issues/469","id":146388894,"user":{"login":"MitchRudominer","id":10732743,"avatar_url":"https://avatars.githubusercontent.com/u/10732743?v=3","gravatar_id":"","url":"https://api.github.com/users/MitchRudominer","html_url":"https://github.com/MitchRudominer","followers_url":"https://api.github.com/users/MitchRudominer/followers","following_url":"https://api.github.com/users/MitchRudominer/following{/other_user}","gists_url":"https://api.github.com/users/MitchRudominer/gists{/gist_id}","starred_url":"https://api.github.com/users/MitchRudominer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitchRudominer/subscriptions","organizations_url":"https://api.github.com/users/MitchRudominer/orgs","repos_url":"https://api.github.com/users/MitchRudominer/repos","events_url":"https://api.github.com/users/MitchRudominer/events{/privacy}","received_events_url":"https://api.github.com/users/MitchRudominer/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T01:30:20Z","updated_at":"2015-10-08T01:30:20Z","body":"These are the built in constant identifiers in Mojom that James is referring to:\r\n    float.INFINITY\r\n    float.NEGATIVE_INFINITY\r\n    float.NAN\r\n    double.INFINITY\r\n    double.NEGATIVE_INFINITY\r\n    double.NAN\r\n\r\nI think that generating a constant approximation is not a good idea. If one of these is found in a .mojom file and the Go language is not capable of expressing it then I think the right thing to do is to emit a warning or error and perhaps the generated Go code could include a comment about the constant."}}