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

import (
	"context"
	"crypto/rand"
	"encoding/base64"
	"io"
)

type (
	// RequestIDOption uses a constructor pattern to customize middleware.
	RequestIDOption func(*RequestIDOptions) *RequestIDOptions

	// RequestIDOptions is the struct storing all the options.
	RequestIDOptions struct {
		// useRequestID if t
    
func GenerateRequestID(ctx context.Context, o *RequestIDOptions) context.Context {
	var id string
	{
		if o.useRequestID {
			if i := ctx.Value(RequestIDKey); i != nil {
				id = i.(string)
				if o.requestIDLimit > 0 && len(id) > o.requestIDLimit {
					id = id[:o.requestIDLimit]
				}
			}
		}
		if id == "" {
			id = shortID()
		}
	}
	return context.WithValue(ctx, RequestIDKey, id) // nolint: staticcheck
}