(e *Encoder)
| 7221 | |
| 7222 | func (codecgenK) codecSelferViaCodecgen() {} |
| 7223 | func (x *codecgenK) CodecEncodeSelf(e *Encoder) { |
| 7224 | var h codecSelfer19780 |
| 7225 | z, r := GenHelper().Encoder(e) |
| 7226 | _, _, _ = h, z, r |
| 7227 | if z.EncBasicHandle().CheckCircularRef { |
| 7228 | z.EncEncode(x) |
| 7229 | return |
| 7230 | } |
| 7231 | if x == nil { |
| 7232 | r.EncodeNil() |
| 7233 | } else { |
| 7234 | yy2arr2 := z.EncBasicHandle().StructToArray |
| 7235 | _ = yy2arr2 |
| 7236 | const yyr2 bool = false // struct tag has 'toArray' |
| 7237 | if yyr2 || yy2arr2 { |
| 7238 | z.EncWriteArrayStart(2) |
| 7239 | z.EncWriteArrayElem() |
| 7240 | r.EncodeInt(int64(x.X)) |
| 7241 | z.EncWriteArrayElem() |
| 7242 | r.EncodeString(string(x.Y)) |
| 7243 | z.EncWriteArrayEnd() |
| 7244 | } else { |
| 7245 | z.EncWriteMapStart(2) |
| 7246 | if z.EncBasicHandle().Canonical { |
| 7247 | z.EncWriteMapElemKey() |
| 7248 | if z.IsJSONHandle() { |
| 7249 | z.EncWr().WriteStr("\"X\"") |
| 7250 | } else { |
| 7251 | r.EncodeString(`X`) |
| 7252 | } |
| 7253 | z.EncWriteMapElemValue() |
| 7254 | r.EncodeInt(int64(x.X)) |
| 7255 | z.EncWriteMapElemKey() |
| 7256 | if z.IsJSONHandle() { |
| 7257 | z.EncWr().WriteStr("\"Y\"") |
| 7258 | } else { |
| 7259 | r.EncodeString(`Y`) |
| 7260 | } |
| 7261 | z.EncWriteMapElemValue() |
| 7262 | r.EncodeString(string(x.Y)) |
| 7263 | } else { |
| 7264 | z.EncWriteMapElemKey() |
| 7265 | if z.IsJSONHandle() { |
| 7266 | z.EncWr().WriteStr("\"X\"") |
| 7267 | } else { |
| 7268 | r.EncodeString(`X`) |
| 7269 | } |
| 7270 | z.EncWriteMapElemValue() |
| 7271 | r.EncodeInt(int64(x.X)) |
| 7272 | z.EncWriteMapElemKey() |
| 7273 | if z.IsJSONHandle() { |
| 7274 | z.EncWr().WriteStr("\"Y\"") |
| 7275 | } else { |
| 7276 | r.EncodeString(`Y`) |
| 7277 | } |
| 7278 | z.EncWriteMapElemValue() |
| 7279 | r.EncodeString(string(x.Y)) |
| 7280 | } |
nothing calls this directly
no test coverage detected