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 reason is obvious, since the function invoked on the outer structure, but I think json library must ignore this kind of marshaller functions.
I test this against the latest version of go (1.4.2) in linux, and also the git version of go .
Any other information is required?
The text was updated successfully, but these errors were encountered:
working as intended.
you've embedded type h0 in type h1, which means
h1 also get h0's methods, which in turn means that
h0 is a a json.Marshaler, but it only marshals the
embedded h0 field.
Having an embeded struct with custom marshalJSON function, make the json.Marshal to use that marshal function in the base structure.
Output must be :
But is :
in playground : https://play.golang.org/p/619v_hL5hh
the reason is obvious, since the function invoked on the outer structure, but I think json library must ignore this kind of marshaller functions.
I test this against the latest version of go (1.4.2) in linux, and also the git version of go .
Any other information is required?
The text was updated successfully, but these errors were encountered: