FAQ
Hi,

I have run into a problem of failing to be able to Marshal and Unmarshal
structures which implement an interface but their JSON-signatures are the
same, i.e:

type some_error struct{
    Message string `json,message`
    ErrorCode string `json,errorCode`
}

type some_error struct2{
    Message string `json,message`
    ErrorCode string `json,errorCode`
}

Initially I was thinking of including an error type name as part of JSON
message which would be used to guide the unmarshaller but was wondering if
there are better ways to do that?

Best,
Marek

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 30, '16 at 11:33p
activeMar 30, '16 at 11:47p
posts2
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase