func Run(input Input) ([]byte, error) {
	request, err := createInvokeRequest(input)
	if err != nil {
		return nil, err
	}
	client, err := rpc.Dial("tcp", fmt.Sprintf(":%d", input.Port))
	if err != nil {
		return nil, err
	}
	var response messages.InvokeResponse
	if err = client.Call(functioninvokeRPC, request, &response); err != nil {
		return nil, err
	}
	if response.Error != nil {
		return nil, errors.New(response.Error.Message)
	}
	return response.Payload, nil
}
Run a Go based lambda, passing the configured payload
note that 'payload' can be anything that can be encoded by encoding/json
package golambdainvoke
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/rpc"
	"time"
	"github.com/aws/aws-lambda-go/lambda/messages"
	lc "github.com/aws/aws-lambda-go/lambdacontext"
)
const functioninvokeRPC = "Function.Invoke"
type Input = struct {
	Port int
	Payload interface{}
	ClientContext *lc.ClientContext
	Deadline *messages.InvokeRequest_Timestamp
}