I think that you misunderstand my meaning. The input I wondered is from the keyboards, like this <https://play.golang.org/p/wOjUtEoMkZU>. I have no idea how to implement it with termui. Besides, I edit the code <https://play.golang.org/p/dnZcwbc7aYJ> to print something after closing the UI. However, the result seems strange. The result appears with the UI and then disappeared with the UI.
Thanks for your replying. Max Brian Candler於 2020年4月16日星期四 UTC+8下午7時21分11秒寫道: > > inputParagraph.Text = fmt.Scanf("%s", input) // Error: assignment > mismatch: 1 variable but fmt.Scanf returns 2 values > > The error message is clear: fmt.Scanf returns two values (BTW, neither of > them is the value extracted). Check the documentation for fmt.Scanf here: > https://golang.org/pkg/fmt/#Scanf > https://golang.org/pkg/fmt/#hdr-Scanning > https://golang.org/pkg/fmt/#example_Sscanf > > outputParagraph.Text += fmt.Printf("The string you entered is: %s", input) > // multiple-value fmt.Printf() in single-value context > > In this case you want fmt.Sprintf instead: > https://golang.org/pkg/fmt/#Sprintf > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2d109ade-042f-4f35-9bcf-d24b398fa1a1%40googlegroups.com.