Deprecate NewModel() constructors; use New() instead

This commit is contained in:
Christian Rocha
2022-01-10 18:27:33 -05:00
parent 9401ebbb83
commit b35f96cd2d
6 changed files with 41 additions and 11 deletions

View File

@@ -153,7 +153,7 @@ type Model struct {
}
// NewModel creates a new model with default settings.
func NewModel() Model {
func New() Model {
return Model{
Prompt: "> ",
BlinkSpeed: defaultBlinkSpeed,
@@ -174,6 +174,11 @@ func NewModel() Model {
}
}
// NewModel creates a new model with default settings.
//
// Deprecated. Use New instead.
var NewModel = New
// SetValue sets the value of the text input.
func (m *Model) SetValue(s string) {
runes := []rune(s)