Skip to content

Commit

Permalink
meta错误
Browse files Browse the repository at this point in the history
  • Loading branch information
zgwit committed Oct 29, 2024
1 parent fcdc7a5 commit 0f999b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/accumulate/accumulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (a *Accumulation) Init() (err error) {
func (a *Accumulation) Evaluate(args any) (result *Result, err error) {
var ret Result

//目标
//目标库
if a._target != nil {
ret.Target, err = a._target.EvalString(context.Background(), args)
if err != nil {
Expand All @@ -95,17 +95,18 @@ func (a *Accumulation) Evaluate(args any) (result *Result, err error) {

//过滤器
ret.Meta = make(map[string]any)
for key, value := range a._meta {
if value != nil {
ret.Meta[key], err = a._target(context.Background(), args)
for key, value := range a.Meta {
if val, has := a._meta[key]; has {
ret.Meta[key], err = val(context.Background(), args)
if err != nil {
return
}
} else {
ret.Meta[key] = a.Meta[key]
ret.Meta[key] = value
}
}

//值
ret.Values = make(map[string]any)

for _, f := range a._fields {
Expand Down

0 comments on commit 0f999b6

Please sign in to comment.