File tree Expand file tree Collapse file tree 1 file changed +25
-28
lines changed Expand file tree Collapse file tree 1 file changed +25
-28
lines changed Original file line number Diff line number Diff line change 11package delta
22
3- import (
4- "reflect"
5- )
6-
7- // ZipStructSlice 对Struct序列进行压缩
8- func ZipStructSlice [T any ](slice []T ) {
9-
10- }
11-
12- func diff [T any ](a , b T ) * StructDelta {
13- reflectA := reflect .ValueOf (a )
14- reflectB := reflect .ValueOf (b )
15-
16- switch reflectA .Type ().Kind () {
17- case reflect .String :
18-
19- }
20- }
21-
22- type StructDelta struct {
23- Init any
24- FieldDeltaMap map [string ]* FieldDelta
25- }
26-
27- type FieldDelta struct {
28- FieldName string
29- FieldValue string
30- }
3+ // TODO 2022-12-2 00:17:18 struct的diff对比
4+ //// ZipStructSlice 对Struct序列进行压缩
5+ //func ZipStructSlice[T any](slice []T) {
6+ //
7+ //}
8+ //
9+ //func diff[T any](a, b T) *StructDelta {
10+ // reflectA := reflect.ValueOf(a)
11+ // reflectB := reflect.ValueOf(b)
12+ //
13+ // switch reflectA.Type().Kind() {
14+ // case reflect.String:
15+ //
16+ // }
17+ //}
18+ //
19+ //type StructDelta struct {
20+ // Init any
21+ // FieldDeltaMap map[string]*FieldDelta
22+ //}
23+ //
24+ //type FieldDelta struct {
25+ // FieldName string
26+ // FieldValue string
27+ //}
You can’t perform that action at this time.
0 commit comments