You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UnmarshalText method decodes a JSON string into the object. In your example you do not have a string, you have an object, so the JSON decoder does not know what to do.
Questions about how to use UnmarshalText would be better handled in a forum rather than the issue tracker. Please see https://golang.org/wiki/Questions . Thanks.
Hi @ianlancetaylor
thansk for your prompt reply and close the issue.
But I don't think you understand my problem properly.
what I was trying to say is "when using json to unmarshal a structure, i.e. Bar in this example, it will fail once Bar structure ever impled TextUnmarshaler interface". But you didn't explain any thing about that.
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6.2
go env
)?we suffered an issue with json/unmarshal.
the following example works well as we expected
but everything mess up when we added an interface UnmarshalText interface to Bar structure
I think it is a bug cuz I cannot find any documentation for this. thanks
The text was updated successfully, but these errors were encountered: