pkg
generics

generics

Explore the following sections to learn more:

generics

import "github.com/gemini-oss/rego/pkg/common/generics"

pkg/common/generics/generics.go

Index

func UnmarshalGeneric

func UnmarshalGeneric[T any, M any](data []byte) (*T, error)

UnmarshalGeneric unmarshals JSON into a generic struct T that contains an inline generic field of type M. The generic field is automatically detected by scanning T for a field whose type is M (or a pointer to M). All keys that are not consumed by other fields are assumed to belong to this generic field.

Generated by gomarkdoc