MCPcopy Index your code
hub / github.com/goccy/go-json / lastFieldCode

Method lastFieldCode

internal/encoder/code.go:386–395  ·  view source on GitHub ↗
(field *StructFieldCode, firstField *Opcode)

Source from the content-addressed store, hash-verified

384}
385
386func (c *StructCode) lastFieldCode(field *StructFieldCode, firstField *Opcode) *Opcode {
387 if isEmbeddedStruct(field) {
388 return c.lastAnonymousFieldCode(firstField)
389 }
390 lastField := firstField
391 for lastField.NextField != nil {
392 lastField = lastField.NextField
393 }
394 return lastField
395}
396
397func (c *StructCode) lastAnonymousFieldCode(firstField *Opcode) *Opcode {
398 // firstField is special StructHead operation for anonymous structure.

Callers 1

ToOpcodeMethod · 0.95

Calls 2

isEmbeddedStructFunction · 0.85

Tested by

no test coverage detected