MCPcopy Create free account
hub / github.com/astercloud/aster / DecodeValue

Function DecodeValue

pkg/store/json.go:476–488  ·  view source on GitHub ↗

DecodeValue 将 any 解码为具体类型

(src any, dest any)

Source from the content-addressed store, hash-verified

474
475// DecodeValue 将 any 解码为具体类型
476func DecodeValue(src any, dest any) error {
477 // 先序列化为 JSON,再反序列化到目标类型
478 data, err := json.Marshal(src)
479 if err != nil {
480 return fmt.Errorf("marshal: %w", err)
481 }
482
483 if err := json.Unmarshal(data, dest); err != nil {
484 return fmt.Errorf("unmarshal: %w", err)
485 }
486
487 return nil
488}

Callers 15

ListMethod · 0.92
GetExecutionsMethod · 0.92
ListSessionsMethod · 0.92
ListMethod · 0.92
ListMethod · 0.92
ListMethod · 0.92
GetCheckpointsMethod · 0.92
ListMethod · 0.92
ListEvalsMethod · 0.92
ListBenchmarksMethod · 0.92
ListWorkingMemoryMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected