Skip to content

path for Interface{} #4

@xehrad

Description

@xehrad

When the field is an interface, can you cover this type of field for setting the value of the interface, for example:

type (
	StructI struct {
		FieldI interface{} `json:"fieldI"`
	}
	StructZ struct {
		Field0  bool         `json:"field0"`
		Field1  string       `json:"field1"`
	}
)

instance := &StructI{}
instance.FieldI = new(StructZ)
obj, _ := dot.New(instance)
obj.Insert("FieldI.Field0", true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions