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

貢獻者指南