swagger-api/swagger-codegen

[golang] Default to pointers for non-primitive types

Open

#2,330 建立於 2016年3月7日

在 GitHub 查看
 (14 留言) (0 反應) (0 負責人)HTML (12,701 star) (5,474 fork)batch import
Client: GoEnhancement: GeneralGeneral: Discussionhelp wanted

描述

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"`
}

貢獻者指南

[golang] Default to pointers for non-primitive types · swagger-api/swagger-codegen#2330 | Good First Issue