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: danger.go
    path of file: ./repos/podman/vendor/github.com/pelletier/go-toml/v2/internal/danger
    
    the code of the file until where you have to start completion: package danger

import (
	"fmt"
	"reflect"
	"unsafe"
)

const maxInt = uintptr(int(^
    
func BytesRange(start []byte, end []byte) []byte {
	if start == nil || end == nil {
		panic("cannot call BytesRange with nil")
	}
	startp := (*reflect.SliceHeader)(unsafe.Pointer(&start))
	endp := (*reflect.SliceHeader)(unsafe.Pointer(&end))

	if startp.Data > endp.Data {
		panic(fmt.Errorf("start pointer address (%d) is after end pointer address (%d)", startp.Data, endp.Data))
	}

	l := startp.Len
	endLen := int(endp.Data-startp.Data) + endp.Len
	if endLen > l {
		l = endLen
	}

	if l > startp.Cap {
		panic(fmt.Errorf("range length is larger than capacity"))
	}

	return start[:l]
}