mapstructure icon indicating copy to clipboard operation
mapstructure copied to clipboard

Expected a map, got 'interface'

Open du99cy opened this issue 2 years ago • 0 comments

image

This is a common function for create a item with given model and dto. The issue is summarized like the following:

  • data has type of interface{} | dto.CreateDeliveryOrderDTO
  • ins has type of interface{} | *model.DeliveryOrder

I want to decode from data to ins so that insert to database by GORM. But I got a error expected a map, got interface. Any way to fix it for me? Thank you.

du99cy avatar Oct 26 '23 11:10 du99cy