Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否支持结构体内嵌字段到切片的拷贝 #218

Open
luoshaofeng opened this issue Sep 10, 2024 · 0 comments
Open

能否支持结构体内嵌字段到切片的拷贝 #218

luoshaofeng opened this issue Sep 10, 2024 · 0 comments
Assignees

Comments

@luoshaofeng
Copy link

Describe the feature

比如有结构体A和D

type A struct{
    C int
    D *D
}

type D struct{
    B int
    E int
}

有切片var as []A,var ds[]D,以类似copier.Copy(&ds,as)的方式,直接把A.D拷贝到ds切片中

Motivation

简化代码,不用遍历A切片

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants