diff icon indicating copy to clipboard operation
diff copied to clipboard

Diffing embedded structs and slices causes the tag name to be lost.

Open kom0055 opened this issue 3 months ago • 0 comments

Diffing embedded structs and slices causes the tag name to be lost.

type A struct {

	Field1 struct {
		Field2 string  `diff:"F1"`
	} `diff:"F2"`
}

when i use diff, i see embedded Field2 will lose tag F2. Cause new differ in method struct value does not copy tag name, so tagname is lost

func (d *Differ) structValues(t string, path []string, a reflect.Value) error {
	var nd Differ
	nd.Filter = d.Filter
	nd.customValueDiffers = d.customValueDiffers

kom0055 avatar Oct 30 '25 20:10 kom0055