(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions)
| 113 | } |
| 114 | |
| 115 | func (op *averageFloat64Operator) next(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions) { |
| 116 | switch v := item.V.(type) { |
| 117 | default: |
| 118 | Error(IllegalInputError{error: fmt.Sprintf("expected type: float or int, got: %t", item)}).SendContext(ctx, dst) |
| 119 | operatorOptions.stop() |
| 120 | case int: |
| 121 | op.sum += float64(v) |
| 122 | op.count++ |
| 123 | case float32: |
| 124 | op.sum += float64(v) |
| 125 | op.count++ |
| 126 | case float64: |
| 127 | op.sum += v |
| 128 | op.count++ |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func (op *averageFloat64Operator) err(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions) { |
| 133 | defaultErrorFuncOperator(ctx, item, dst, operatorOptions) |
nothing calls this directly
no test coverage detected