structx

package
v2.47.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package structx provides utilities for working with structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldIndexByTag

func FieldIndexByTag(t reflect.Type, key string, value string) int

FieldIndexByTag returns the index of the field with the given tag key and value. Returns -1 if the field is not found. Panics if the type's kind is not a struct.

func InferFieldNames

func InferFieldNames(t reflect.Type, key string) []string

InferFieldNames returns the field names of the given struct type and tag key. Includes only exported fields. If a field's tag key is empty or not set, uses the field's name. If a field's tag key is set to '-', omits the field. Panics if the type's kind is not a struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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