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: test_context.go
    path of file: ./repos/godog
    
    the code of the file until where you have to start completion: package godog

import (
	"context"
	"fmt"
	"reflect"
	"regexp"

	"github.com/cucumber/godog/formatters"
	"github.com/cucumber/godog/internal/builder"
	"github.com/cucumber/godog/internal/flags"
	"github.com/cucumber/godog/internal/models"
	messages "github.com/cucumber/messages/go/v21"
)

// GherkinDocument re
    
func (ctx ScenarioContext) stepWithKeyword(expr interface{}, stepFunc interface{}, keyword formatters.Keyword) {
	var regex *regexp.Regexp

	switch t := expr.(type) {
	case *regexp.Regexp:
		regex = t
	case string:
		regex = regexp.MustCompile(t)
	case []byte:
		regex = regexp.MustCompile(string(t))
	default:
		panic(fmt.Sprintf("expecting expr to be a *regexp.Regexp or a string, got type: %T", expr))
	}

	v := reflect.ValueOf(stepFunc)
	typ := v.Type()
	if typ.Kind() != reflect.Func {
		panic(fmt.Sprintf("expected handler to be func, but got: %T", stepFunc))
	}

	if typ.NumOut() > 2 {
		panic(fmt.Sprintf("expected handler to return either zero, one or two values, but it has: %d", typ.NumOut()))
	}

	def := &models.StepDefinition{
		StepDefinition: formatters.StepDefinition{
			Handler: stepFunc,
			Expr:    regex,
			Keyword: keyword,
		},
		HandlerValue: v,
	}

	if typ.NumOut() == 1 {
		typ = typ.Out(0)
		switch typ.Kind() {
		case reflect.Interface:
			if !typ.Implements(errorInterface) && !typ.Implements(contextInterface) {
				panic(fmt.Sprintf("expected handler to return an error or context.Context, but got: %s", typ.Kind()))
			}
		case reflect.Slice:
			if typ.Elem().Kind() != reflect.String {
				panic(fmt.Sprintf("expected handler to return []string for multistep, but got: []%s", typ.Elem().Kind()))
			}
			def.Nested = true
		default:
			panic(fmt.Sprintf("expected handler to return an error or []string, but got: %s", typ.Kind()))
		}
	}

	ctx.suite.steps = append(ctx.suite.steps, def)
}