Skip to content

Commit

Permalink
Bit more clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jyang0 committed Jan 29, 2018
1 parent 8629f6a commit 9f2b7b5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions codegen/type_converter.go
Expand Up @@ -694,11 +694,7 @@ func (c *TypeConverter) genStructConverter(
stFromType = fromField.Type
stFromPrefix = keyPrefix + pascalCase(fromField.Name)

var err error
fromTypeName, err = c.getIdentifierName(stFromType)
if err != nil {
fromTypeName = ""
}
fromTypeName, _ = c.getIdentifierName(stFromType)
}

toTypeName, err := c.getIdentifierName(toFieldType)
Expand Down Expand Up @@ -810,11 +806,7 @@ func (c *TypeConverter) GenStructConverter(
}
}

if c.isRecursiveStruct(toFields) || c.isRecursiveStruct(fromFields) {
c.useRecurGen = true
} else {
c.useRecurGen = false
}
c.useRecurGen = c.isRecursiveStruct(toFields) || c.isRecursiveStruct(fromFields)

if c.useRecurGen && len(fieldMap) != 0 {
c.append("inOriginal := in; _ = inOriginal")
Expand Down

0 comments on commit 9f2b7b5

Please sign in to comment.