Help us shape the future of Go! Take the 2026 Go Developer Survey

formfields

package
v1.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name     string `json:"name"`
	Required bool   `json:"required"`
	Type     string `json:"type"`
	Options  string `json:"options"`
	Default  string `json:"default"`
	Help     string `json:"help"`
}

func Parse

func Parse(v any) []Field

Parse reflects v's exported fields into a list of form-field descriptors, reading the json/required/type/options/default/help struct tags. v must be a struct or a non-nil pointer to one; anything else (including nil) yields no items instead of panicking. A field tagged json:"-" is skipped, matching encoding/json's convention for excluding a field.

Jump to

Keyboard shortcuts

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