Skip to content

Commit

Permalink
fix(utils): fix an issue when the Auto parameter is a pointer in clie…
Browse files Browse the repository at this point in the history
…nt generation (#411)

Co-authored-by: iawia002 <[email protected]>
  • Loading branch information
caicloud-bot and iawia002 authored Dec 8, 2020
1 parent 35b52e9 commit 5714d9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/generators/golang/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ func (h *helper) Functions() ([]function, []string) {

func (h *helper) enumFields(name api.TypeName, key string, fn func(key string, source string, field api.StructField)) {
typ := h.definitions.Types[name]
if typ.Kind == reflect.Ptr {
typ = h.definitions.Types[typ.Elem]
}

if typ.Kind == reflect.Struct {
if key != "" {
key += "."
Expand Down

0 comments on commit 5714d9a

Please sign in to comment.