优化部分实现
This commit is contained in:
+558
-287
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,8 @@ type NestedStruct struct {
|
|||||||
Basic BasicStruct `json:"basic"`
|
Basic BasicStruct `json:"basic"`
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
Amount decimal.Decimal `json:"amount"`
|
Amount decimal.Decimal `json:"amount"`
|
||||||
|
Amount2 *decimal.Decimal `json:"amount2"`
|
||||||
|
Timestamp time.Time `json:"timestamp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 指针嵌套结构体
|
// 指针嵌套结构体
|
||||||
@@ -593,6 +595,8 @@ func BenchmarkAttactToStruct_Nested(b *testing.B) {
|
|||||||
"basic.is_active": "true",
|
"basic.is_active": "true",
|
||||||
"comment": "test",
|
"comment": "test",
|
||||||
"amount": "500.0",
|
"amount": "500.0",
|
||||||
|
"amount2": "250.0",
|
||||||
|
"timestamp": "2024-01-01T12:00:00Z",
|
||||||
}
|
}
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|||||||
Reference in New Issue
Block a user