From 154f3763f79429a14c4bdd0f0fd0d90a19c6888d Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 15 Oct 2020 18:43:08 -0400 Subject: [PATCH] textinput.View can just accept a textinput.Model argument --- textinput/textinput.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index aab800c..8a67aba 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -396,12 +396,7 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) { } // View renders the textinput in its current state. -func View(model tea.Model) string { - m, ok := model.(Model) - if !ok { - return "could not perform assertion on model" - } - +func View(m Model) string { // Placeholder text if len(m.value) == 0 && m.Placeholder != "" { return placeholderView(m)