jfrog / jfrog-client-go

All go clients for JFrog products
Apache License 2.0
260 stars 140 forks source link

Can you enable instances to be filled with json? #346

Open Pymann opened 3 years ago

Pymann commented 3 years ago

I think the subject is enough explanation.

Do you really want every user to call hundreads of Set Function? If it could be a oneliner: json.Unmarshal(bytes, &instance_of_config_or_whatever)

eyalbe4 commented 3 years ago

Hi @Pymann, There's a chance I didn't fully get what you're suggesting, so please correct me if I'm wrong, but doesn't the code supports this already? Can't you already unmarshall instead of using the set functions? What's missing?

Pymann commented 3 years ago

Only exportable struct-fields can be un/marshaled, because other ones are private. You know meaning of lower/upper-case of capital letter of struct-field-name?