mirror

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StructIter

type StructIter struct {
	// contains filtered or unexported fields
}

StructIter is an iterator for ranging over a struct's fields with their values

func NewStructIter

func NewStructIter(val reflect.Value) *StructIter

NewStructIter returns a new instance of StructIter for the specified value. It returns nil if v's Kind is not Struct.

func StructRange

func StructRange(v interface{}) *StructIter

func (StructIter) Field

func (it StructIter) Field() reflect.StructField

Field returns the struct field of the iterator's current entry.

func (*StructIter) Next

func (it *StructIter) Next() bool

Next advances the iterator and reports whether there is another entry. It returns false when the iterator is exhausted; subsequent calls will panic.

func (StructIter) Value

func (it StructIter) Value() reflect.Value

Value returns the value of the iterator's current entry.

Jump to

Keyboard shortcuts

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