How to prevent the form binding of a perticular field in golang echo framework?

391 Views Asked by At

For example type student struct{ ID int form:"-" Name string form:"name" Details string form:"details" }

Here i do not want bind function in echo to bind id from the create student request to ID. but if i post like. -:1 name:student details:student

it will bind - value to ID which i do not want.

And if i skip form tag as shown below type student struct{ ID int Name string form:"name" Details string form:"details" }

then do a post request

id:1 name:student details:student

now the bind function will bind id with ID.

the problem is I am not able to skip binding for ID field

0

There are 0 best solutions below