(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions)
| 66 | } |
| 67 | |
| 68 | func (op *averageFloat32Operator) next(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions) { |
| 69 | switch v := item.V.(type) { |
| 70 | default: |
| 71 | Error(IllegalInputError{error: fmt.Sprintf("expected type: float or int, got: %t", item)}).SendContext(ctx, dst) |
| 72 | operatorOptions.stop() |
| 73 | case int: |
| 74 | op.sum += float32(v) |
| 75 | op.count++ |
| 76 | case float32: |
| 77 | op.sum += v |
| 78 | op.count++ |
| 79 | case float64: |
| 80 | op.sum += float32(v) |
| 81 | op.count++ |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | func (op *averageFloat32Operator) err(ctx context.Context, item Item, dst chan<- Item, operatorOptions operatorOptions) { |
| 86 | defaultErrorFuncOperator(ctx, item, dst, operatorOptions) |
nothing calls this directly
no test coverage detected