aboutsummaryrefslogblamecommitdiff
path: root/helpers.go
blob: a842899849d5252f3195585ff51fda9fb4949c5c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                
package lexpr

import "context"

func (l *Lexpr) OneResult(ctx context.Context, expression string) (any, error) {
	select {
	case r := <-l.Eval(ctx, expression):
		return r.Value, r.Error
	case <-ctx.Done():
		return nil, nil
	}
}