From 396a37d32f9c7a55ee804529b2ba952315bd24de Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 20 Nov 2025 11:42:06 +0800 Subject: [PATCH] Refactor persistNode struct for improved readability and consistency in driver.go - Adjusted the formatting of the persistNode struct fields to enhance code clarity by aligning the field definitions. - Maintained the existing functionality while improving the overall structure for better maintainability. --- trace/store/driver.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/trace/store/driver.go b/trace/store/driver.go index 066e5290..880a4031 100644 --- a/trace/store/driver.go +++ b/trace/store/driver.go @@ -14,20 +14,20 @@ import ( // persistNode is a lightweight version of TraceNode for storage // Only stores IDs of children instead of full child nodes type persistNode struct { - ID string `json:"ID"` - ParentID string `json:"ParentID"` - ChildrenIDs []string `json:"ChildrenIDs,omitempty"` - Label string `json:"Label,omitempty"` - Icon string `json:"Icon,omitempty"` - Description string `json:"Description,omitempty"` - Metadata map[string]any `json:"Metadata,omitempty"` - Status types.NodeStatus `json:"Status"` - Input types.TraceInput `json:"Input,omitempty"` - Output types.TraceOutput `json:"Output,omitempty"` - CreatedAt int64 `json:"CreatedAt"` - StartTime int64 `json:"StartTime"` - EndTime int64 `json:"EndTime,omitempty"` - UpdatedAt int64 `json:"UpdatedAt"` + ID string `json:"ID"` + ParentID string `json:"ParentID"` + ChildrenIDs []string `json:"ChildrenIDs,omitempty"` + Label string `json:"Label,omitempty"` + Icon string `json:"Icon,omitempty"` + Description string `json:"Description,omitempty"` + Metadata map[string]any `json:"Metadata,omitempty"` + Status types.NodeStatus `json:"Status"` + Input types.TraceInput `json:"Input,omitempty"` + Output types.TraceOutput `json:"Output,omitempty"` + CreatedAt int64 `json:"CreatedAt"` + StartTime int64 `json:"StartTime"` + EndTime int64 `json:"EndTime,omitempty"` + UpdatedAt int64 `json:"UpdatedAt"` } // toPersistNode converts TraceNode to persistNode for storage