echox icon indicating copy to clipboard operation
echox copied to clipboard

Unknow Type when binding slice of struct in formdata request

Open bashayerAlsalman opened this issue 5 years ago • 0 comments

can not bind a slice of struct when the request type is formdata

type request struct {
    id                uint          `form:"id" json:"id"`
    Products   []product `form:"products"`
}

type product struct {
    Name          string      `form:"name"`
    Quantity      int           `form:"quantity"`
   Price              float32  `form:"price"`
}

bashayerAlsalman avatar Nov 08 '20 09:11 bashayerAlsalman