gorilla / schema

Package gorilla/schema fills a struct with form values.
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
1.39k stars 231 forks source link

[FEATURE] Documentation #208

Closed bconn98 closed 5 months ago

bconn98 commented 9 months ago

Is there an existing feature request for this?

Is your feature request related to a problem? Please describe.

No where in the README (the only documentation I can find), does it say that the fields of the structs need to be public. That's a basic and easy concept to add to the documentation.

Describe the solution that you would like.

Documentation on using the tools

Describe alternatives you have considered.

No response

Anything else?

No response

AlexVulaj commented 9 months ago

Hey @bconn98 , thanks for bringing this up - it's a good suggestion. Would you mind opening up a pull request with what you had in mind and linking it to this issue?

bconn98 commented 8 months ago

It'll take me a bit to get to, but will do.

jaitaiwan commented 8 months ago

I think that it is implicit in how Go works. I understand that for folks new to Go it might not be obvious — but there's no way for an ext library (except maybe reflect but haven't looked into that) to see the private fields of a struct. I'm okay with it being documented, I don't think it can hurt... Just noting I don't think it's strictly necessary.

jaitaiwan commented 5 months ago

From what I can tell, there's a bug complaining about unexported fields actually being exported anyway (#203) so I'm going to close this one out and note that we'll document the difference when we do a fix for the aforementioned bug.