Hello,
I am new to Go. I have structure like this for my REST POST request:
type Service struct {
ID string `json:"id,omitempty" db:"id"`
Name string `json:"name" db:"name"`
Contract struct {
Ha string `json:"ha"`
ServiceTime int `json:"service_time"`
Region string `json:"region"`
} `json:"contract" db:"contract"`
}
If I change Contract type to String, the contract will be pushed as empty string in DB. I am storing Contract as blob type. What should I do to get the request as json and store in DB as blob ?
Thanks