learning_go/pkg/mod/github.com/dixonwille/wmenu@v4.0.2+incompatible/option.go
a.pivkin 59666d0dd6 wer
2025-09-06 13:02:52 +03:00

22 lines
477 B
Go

package wmenu
//Opt is what Menu uses to display options to screen.
//Also holds information on what should run and if it is a default option
type Opt struct {
ID int
Text string
Value interface{}
function func(Opt) error
isDefault bool
}
func newOption(id int, text string, value interface{}, def bool, function func(Opt) error) *Opt {
return &Opt{
ID: id,
Text: text,
Value: value,
isDefault: def,
function: function,
}
}