There is a speed hit to reflection, though, right?
Also, you do lose the benefit of static typing, for example, the following typo isn't picked up at compile time:
type User struct {
Name string `form:"nam"`
}
Tags are rather ugly and don't scale to many options well. What happens when your ORM, form validation library, xml library, and json libraries each need a separate tag? That's a slight exaggeration but you could see how the apparent simplicity in the form example can quickly become anything but.
Heavy use of tags (and reflection) just makes me feel like you have to work around the language too much and I question whether you may as well just use Python, hence my original question.
I've done minimal work with Go, though, so perhaps I'm misinformed.
There is a speed hit to reflection. As for the tag issue: writing your own marshaler isn't actually a huge problem. I have been meaning to write my own json marshaler for a while. I personally find the solution much more paletable than many other ways of marshaling in and out of json.
Also, you do lose the benefit of static typing, for example, the following typo isn't picked up at compile time:
Tags are rather ugly and don't scale to many options well. What happens when your ORM, form validation library, xml library, and json libraries each need a separate tag? That's a slight exaggeration but you could see how the apparent simplicity in the form example can quickly become anything but.Heavy use of tags (and reflection) just makes me feel like you have to work around the language too much and I question whether you may as well just use Python, hence my original question.
I've done minimal work with Go, though, so perhaps I'm misinformed.