teisipäev, 21. juuni 2016 9:47.54 UTC+3 kirjutas rog:
>
> I feel your pain - we quite often have tags with entries for three 
> formats (JSON, YAML and BSON) - but I'm not sure that collapsing them 
> is necessarily a good idea, as the named tags indicate that the object 
> is explicitly intended to be able to be marshaled with those formats. 
>

Another idea is to allow the tags to be defined by more than one string:

type Payment struct { 
    ActionType paypal.ActionType `xml:"actionType,omitempty"` 
 `json:"action"`
    ReceiverList paypal.ReceiverList 
`xml:"receiverList,omitempty"`  `json:"receiver"`
} 

compiler would concatenate them into single string so all code will 
continue to work but this would allow the gofmt to align them into neat 
columns, making it easier to read.


ain 

-- 
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, visit https://groups.google.com/d/optout.

Reply via email to