gen icon indicating copy to clipboard operation
gen copied to clipboard

Fixed generation of DAOs for generic structs

Open bumberboy opened this issue 3 years ago • 1 comments

  • [x] Do only one thing
  • [x] Non breaking API changes
  • [x] Tested

What did this pull request do?

Allow gen to generate DAO for generic structs. This throws up an error previously

User Case Description

type User[T any] struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
	Params      T `gorm:"type:json;serializer:json"`
}

g := gen.NewGenerator(cfg)
g.ApplyBasic(User[any]{})
g.Execute()

bumberboy avatar Feb 08 '23 08:02 bumberboy

Hi @bumberboy

Can you add some tests?

jinzhu avatar May 10 '23 09:05 jinzhu