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

Changlog #1

Open
guonaihong opened this issue Apr 15, 2020 · 1 comment
Open

Changlog #1

guonaihong opened this issue Apr 15, 2020 · 1 comment

Comments

@guonaihong
Copy link
Contributor

guonaihong commented Apr 15, 2020

草稿

0.普通递归拷贝

deepcopy.Copy(dst, src).Do()

1.控制拷贝层次,下面结构体只拷贝一层

deepcopy.Copy().MaxDepth(1).Do()

2.只拷贝指定tag的字段

deepcopy.Copy().RegisterTagName("copy").Do()

3.只拷贝string和int类型

deepcopy.Copy().OnlyType(reflect.String, reflect.Int).Do()

4.支持字段选择

deepcopy.Copy().OnlyField("id", "idx").Do()
deepcopy.Copy().OnlyField(".struct2", ".struct3").Do()

5.支持效验器,不符合要求的数据不copy

deepcopy.Copy().NeeValid(deepcopy.String()).Do()

TODO

第3,4,5条暂时不实现。

@guonaihong
Copy link
Contributor Author

guonaihong commented May 17, 2023

v0.0.10版本之前的功能

  1. 支持不同类型的struct之间的复制(这是v0.0.10就实现的功能)。
    2. 结构体里面的字段类型相同,名字一样
    3. 如果是指针类型,解引用,满足第上面一条原则也行。

v0.1.0 实现的

  1. 相比基于纯reflect的版本提升4-10性能(已实现)
  2. 接下来这个版本的重点只会是bugfix。功足能够稳定,能满足日常工作的场景,才会开启下一轮优化

next大版本(近期不会做)

  1. 性能再提升一倍

@guonaihong guonaihong changed the title 设计目标伪代码 Changlog May 17, 2023
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

1 participant