Clean Up
This commit is contained in:
@@ -42,7 +42,7 @@ type Field struct {
|
||||
Name string
|
||||
Type types.Type
|
||||
Tag string
|
||||
Gorm string
|
||||
Gorm string
|
||||
}
|
||||
|
||||
type Enum struct {
|
||||
@@ -163,21 +163,21 @@ func (m *Plugin) MutateConfig(cfg *config.Config) error {
|
||||
typ = types.NewPointer(typ)
|
||||
}
|
||||
|
||||
gormType := ""
|
||||
directive := field.Directives.ForName("meta")
|
||||
if directive != nil {
|
||||
arg := directive.Arguments.ForName("gorm")
|
||||
if arg != nil {
|
||||
gormType = fmt.Sprintf("gorm:\"%s\"", arg.Value.Raw)
|
||||
}
|
||||
}
|
||||
gormType := ""
|
||||
directive := field.Directives.ForName("meta")
|
||||
if directive != nil {
|
||||
arg := directive.Arguments.ForName("gorm")
|
||||
if arg != nil {
|
||||
gormType = fmt.Sprintf("gorm:\"%s\"", arg.Value.Raw)
|
||||
}
|
||||
}
|
||||
|
||||
it.Fields = append(it.Fields, &Field{
|
||||
Name: name,
|
||||
Type: typ,
|
||||
Description: field.Description,
|
||||
Tag: `json:"` + field.Name + `"`,
|
||||
Gorm: gormType,
|
||||
Gorm: gormType,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user