swagger-api/swagger-codegen
在 GitHub 查看[golang] Default to pointers for non-primitive types
Open
#2,330 建立於 2016年3月7日
Client: GoEnhancement: GeneralGeneral: Discussionhelp wanted
倉庫指標
- Star
- (12,701 star)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
It generates code like this currently:
type JobWrapper struct {
Job Job `json:"job,omitempty"`
}
Same with slices and what not.
It would be nice (and probably what most people would want) to have it use pointers, eg:
type JobWrapper struct {
Job *Job `json:"job,omitempty"`
}