compiler will warn me when I forget a field.
On Monday, November 28, 2016 at 1:35:42 PM UTC+1, Mirco Zeiss wrote:
>
> Sorry, but it won't work. I'm using the same marshal method when
> communicating with my DB as when communicating to my frontend. How can I
> tell it to someti
Sorry, but it won't work. I'm using the same marshal method when
communicating with my DB as when communicating to my frontend. How can I
tell it to sometimes leave out the private fields and sometimes not?
On Monday, November 28, 2016 at 6:43:26 AM UTC+1, Mirco Zeiss wrote:
>
>
That might work. Thank you! Will try and report back.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options,
Yeah, I know. But how do I keep the private fields when talking to my
database?
On Friday, November 25, 2016 at 2:04:58 PM UTC+1, Tamás Gulácsi wrote:
>
> Yoz can create a MarshalJSON method on the struct (type), that filters out
> private fields, based on either field name, or a field tag.
--
I'm using CouchDB to store my models. CouchDB uses JSON and HTTP for
communication. Here is a simple user model
type User struct {
Name string `json:"name"`
PasswordHash string `json:"passwordHash"`
}
On the other side I'm also using JSON over HTTP to communicate with my
frontend code. Obvi