Skip to content

easy convert #2

@qicz

Description

@qicz

there are two structs with the same filed

type AA struct {
	Name string
	Addr string
}

type BB struct {
	Name string
	Addr string
}

init A with B data we should init like follow:

aa := A{Name: b.Name, Addr: b.Addr}

sometimes the struct has more fields, this init logic will be too large and cannot be readable.

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