swagger-api/swagger-codegen

[golang] Default to pointers for non-primitive types

Open

#2.330 aberto em 7 de mar. de 2016

Ver no GitHub
 (14 comments) (0 reactions) (0 assignees)HTML (5.474 forks)batch import
Client: GoEnhancement: GeneralGeneral: Discussionhelp wanted

Métricas do repositório

Stars
 (12.701 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador