reflectutil

package
v0.65.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFieldNotFound = errors.New("field not found")

Functions

func FieldTagValue added in v0.62.4

func FieldTagValue(i any, fieldName, tagName string) (string, error)

FieldTagValue returns a tag name. For example, in 'Attribute string: `json:"attribute,omitempty"`', the usage would be `FieldTagValue(s, "Attribute", "json")` which would return `attribute`.

func GetString

func GetString(i any, key string) string

func IsNil

func IsNil(i any) bool

func NameOf added in v0.46.0

func NameOf(i any, inclPkgPath bool) string

NameOf returns the name of a struct. If `inclPkgPath` is set to `true`, a fully-qualified name is returned including package path.

func Set

func Set(i any, key string, value any)

func SliceInterfaceToString

func SliceInterfaceToString(raws any) []string

SliceInterfaceToString converts an `any` to a `[]string`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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