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: handlers_v2.go
    path of file: ./repos/cds/engine/worker/pkg/workerruntime
    
    the code of the file until where you have to start completion: package workerruntime

import (
	"context"
	"encoding/json"
	"io"
	"net/http"
	"time"

	"github.com/gorilla/mux"
	"github.com/ovh
    
func V2_outputHandler(ctx context.Context, wk Runtime) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {

		btes, err := io.ReadAll(r.Body)
		if err != nil {
			writeError(w, r, sdk.NewError(sdk.ErrWrongRequest, err))
			return
		}

		var output OutputRequest
		if err := sdk.JSONUnmarshal(btes, &output); err != nil {
			writeError(w, r, sdk.NewError(sdk.ErrWrongRequest, err))
			return
		}

		// Create step output
		wk.AddStepOutput(ctx, output.Name, output.Value)

		// Create run result
		if !output.StepOnly {
			result := V2RunResultRequest{
				RunResult: &sdk.V2WorkflowRunResult{
					IssuedAt:         time.Now(),
					Status:           sdk.StatusSuccess,
					WorkflowRunID:    output.WorkflowRunID,
					WorkflowRunJobID: output.WorkflowRunJobID,
					Type:             sdk.V2WorkflowRunResultTypeVariable,
					Detail: sdk.V2WorkflowRunResultDetail{
						Data: sdk.V2WorkflowRunResultVariableDetail{
							Name:  output.Name,
							Value: output.Value,
						},
					},
				},
			}

			response, err := wk.V2AddRunResult(ctx, result)
			if err != nil {
				writeError(w, r, err)
				return
			}
			log.Info(ctx, "run result %s created", response.RunResult.ID)
		}

		writeJSON(w, nil, http.StatusNoContent)
	}
}