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

survey

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultValidationRegexPattern = regexp.MustCompile("^.*$")

DefaultValidationRegexPattern is the default regex pattern to validate the input.

Functions

This section is empty.

Types

type QuestionOptions

type QuestionOptions struct {
	Question               string
	DefaultValue           string
	DefaultValueSet        bool
	ValidationRegexPattern string
	ValidationMessage      string
	ValidationFunc         func(value string) error
	Options                []string
	Sort                   bool
	IsPassword             bool
}

QuestionOptions defines a question and its options.

type Survey

type Survey interface {
	Question(params *QuestionOptions) (string, error)
}

Survey is the interface for asking questions.

func NewSurvey

func NewSurvey() Survey

NewSurvey creates a new survey object.

Jump to

Keyboard shortcuts

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