{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/protobuf/issues/22","labels_url":"https://api.github.com/repos/golang/protobuf/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/golang/protobuf/issues/22/comments","events_url":"https://api.github.com/repos/golang/protobuf/issues/22/events","html_url":"https://github.com/golang/protobuf/issues/22","id":62647843,"number":22,"title":"why all generated file is pointer field","user":{"login":"guileen","id":249313,"avatar_url":"https://avatars.githubusercontent.com/u/249313?v=3","gravatar_id":"","url":"https://api.github.com/users/guileen","html_url":"https://github.com/guileen","followers_url":"https://api.github.com/users/guileen/followers","following_url":"https://api.github.com/users/guileen/following{/other_user}","gists_url":"https://api.github.com/users/guileen/gists{/gist_id}","starred_url":"https://api.github.com/users/guileen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guileen/subscriptions","organizations_url":"https://api.github.com/users/guileen/orgs","repos_url":"https://api.github.com/users/guileen/repos","events_url":"https://api.github.com/users/guileen/events{/privacy}","received_events_url":"https://api.github.com/users/guileen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-18T10:10:42Z","updated_at":"2015-03-18T10:15:29Z","closed_at":"2015-03-18T10:15:29Z","body":"I have proto file\r\n\r\n```proto\r\nmessage MsgErrCode {\r\n    required int32 err_code = 1;\r\n    optional string reason = 2;\r\n}\r\n```\r\n\r\nAfter generated, I got go file\r\n\r\n```go\r\ntype MsgErrCode struct {\r\n     ErrCode *int32 `....`\r\n     Reason *string  `....`\r\n}\r\n```\r\n\r\nNotice that the field generated is pointer, It make me hard to use the struct,\r\n\r\nI can't do ``` &MsgErrCode{ErrCode: int32(12), Reason: \"hello world\"}```\r\n\r\nI have to do ``` &MsgErrCode{ErrCode: proto.Int32(12), Reason: proto.String(\"hello world\")}```\r\n"}}