You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: node.go
    path of file: ./repos/gorgonia/x/vm
    
    the code of the file until where you have to start completion: package xvm

import (
	"context"
	"errors"

	"gorgonia.org/gorgonia"
)

// Doer is implementing the Do method of gorgonia's Op interface
type Doer interface {
	Do(...gorgonia.Value) (gorgonia.Value, error)
}

type node struct {
	id             int64
	op             Doer
	output         gorgonia.Value
	outputC        chan gorgonia.Value
	receivedVal
    
func receiveInput(ctx context.Context, n *node) stateFn {
	// if inputC is nil, it is a variable or a constant, don't
	// wait for any input
	if n.inputC == nil {
		return computeFwd
	}
	select {
	case <-ctx.Done():
		n.err = ctx.Err()
		return nil
	case input := <-n.inputC:
		if input.pos >= len(n.inputValues) {
			n.err = errors.New("bad arity")
			return nil
		}
		n.receivedValues++
		n.inputValues[input.pos] = input.v
		if n.receivedValues < len(n.inputValues) {
			return receiveInput
		}
	}
	return computeFwd
}