swagger-api/swagger-codegen

[golang] Default to pointers for non-primitive types

开放

#2,330 创建于 2016年3月7日

 (14 条评论) (0 个反应) (0 位负责人)HTML (5,474 个派生)batch import
Client: GoEnhancement: GeneralGeneral: Discussionhelp wanted

仓库指标

星标
 (12,701 个星标)
PR 合并指标
 (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"`
}

贡献者指南