Join GitHub today
encoding/json: TextMarshaler type map key is not supported #38940
What version of Go are you using (
Here's the order, as per the docs:
To force json to use your marshaler, don't let your type be a string type: https://play.golang.org/p/xMmVspIdMMS
You could argue the first two options should be reversed in the order, but I don't think we can change the documented behavior at this point without breaking a good portion of users.