1

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

jub0bs
  • 60,866
  • 25
  • 183
  • 186
  • please share your code for clarification. – Hossein Sep 04 '20 at 09:03
  • AFAICT this is not currently possible, not with the default binder. You'll need to use a custom binder, or no binder at all and instead use some 3rd party lib that does form-unmarshaling the way you need it to be done. If you care looking deeper into this you'll find the main binding code [here](https://github.com/labstack/echo/blob/master/bind.go#L86-L169). – mkopriva Sep 04 '20 at 09:06

0 Answers0