structs

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(s interface{}, callback CallbackFunc)

Walk traverses a struct and executes a callback function on each field in the struct. The interface{} passed to the function should be a pointer to a struct

Types

type CallbackFunc

type CallbackFunc func(reflect.Value, reflect.StructField)

CallbackFunc on the struct field example: structValue := reflect.ValueOf(s) ... field := structValue.Field(i) fieldType := structValue.Type().Field(i)

Jump to

Keyboard shortcuts

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