Skip to content

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

Description

@kom0055

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions