conv

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T any](v any) (T, error)

As converts v to the desired type T using reflection.

func MapToStruct

func MapToStruct(m map[string]any, dest any) error

MapToStruct copies values from map m to the struct pointed to by dest. Keys are matched to struct fields using orm tags or snake_case names.

func MapsToStructs

func MapsToStructs(src []map[string]any, dest any) error

MapsToStructs converts a slice of maps to a slice of structs.

func Value

func Value[T any](m map[string]any, key string) (T, error)

Value returns the given key from m converted to T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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