package danger

import "github.com/pelletier/go-toml/v2/internal/danger"

Index

Functions

func BytesRange

func BytesRange(start []byte, end []byte) []byte

func Stride

func Stride(ptr unsafe.Pointer, size uintptr, offset int) unsafe.Pointer

func SubsliceOffset

func SubsliceOffset(data []byte, subslice []byte) int

Types

type TypeID

type TypeID unsafe.Pointer

typeID is used as key in encoder and decoder caches to enable using the optimize runtime.mapaccess2_fast64 function instead of the more expensive lookup if we were to use reflect.Type as map key.

typeID holds the pointer to the reflect.Type value, which is unique in the program.

https://github.com/segmentio/encoding/blob/master/json/codec.go#L59-L61

func MakeTypeID

func MakeTypeID(t reflect.Type) TypeID

Source Files

danger.go typeid.go

Version
v2.2.0
Published
Mar 19, 2024
Platform
windows/amd64
Imports
3 packages
Last checked
56 minutes ago

Tools for package owners.