Proposal Details
json/v2 already has the format option format:hex for []byte types. However hex bytes are often encoded with a 0x prefix. This could be made possible by an additional format type (e.g. called 0xhex).
Encoding bytes with 0x-prefix is already possible via a custom (un)marshaler. However, doing this at the library level has the benefit that the encoded string does not need extra checks for escape characters.
Proposal Details
json/v2already has the format optionformat:hexfor[]bytetypes. However hex bytes are often encoded with a0xprefix. This could be made possible by an additional format type (e.g. called0xhex).Encoding bytes with
0x-prefix is already possible via a custom (un)marshaler. However, doing this at the library level has the benefit that the encoded string does not need extra checks for escape characters.