storeutil

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap[K comparable, V any](src map[K]V) map[K]V

CopyMap returns an independent shallow copy of src. Returns nil if src is nil.

func CopySlice

func CopySlice[T any](src []T) []T

CopySlice returns an independent copy of src. Returns nil if src is nil.

func MarshalField

func MarshalField(v interface{}) (json.RawMessage, error)

MarshalField marshals v to json.RawMessage for store persistence. Returns an error so callers can abort the write rather than silently storing malformed JSON.

func UnmarshalField

func UnmarshalField(data []byte, target interface{}, context string) error

UnmarshalField unmarshals raw JSON data into the target pointer. Returns a wrapped error with context suitable for store methods.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL