Go (golang) howto not to export fields of a struct when Unmarshal to json object

Use:

typedef MyData struct {

    Data            string    `json:"data"`   

    FieldName   *int64   `json:"-"` 

}

Adding the `json:"-"` will make the Unmarshal command disregard this field

No comments:

Post a Comment

Setting program_name in mysql session_connect_attrs allows you to see the name of the program connected

I am using mysql for quite some time now. I have noticed that looking at client connections using mysql workbench so an interesting column ...