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

Comments

Popular posts from this blog

Accessing Windows Share (Samba) From Linux (XFCE) using Thunar

My Zed editor config setting json file

Bypassing the error by "go get" "tls: failed to verify certificate: x509: certificate signed by unknown authority"