From e47352f914346a910cc7e1ca9f65a7ac0674449a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 30 May 2022 11:08:44 +0200 Subject: [PATCH] Fix README formatting for select descriptions (#426) --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9081af4..ac2c6fc7 100644 --- a/README.md +++ b/README.md @@ -191,8 +191,11 @@ prompt := &survey.MultiSelect{..., PageSize: 10} // or as an option to Ask or AskOne survey.AskOne(prompt, &days, survey.WithPageSize(10)) +``` + +#### Select options description -#### Select option's description +The optional description text can be used to add extra information to each option listed in the select prompt: ```golang color := "" @@ -207,6 +210,9 @@ prompt := &survey.Select{ }, } survey.AskOne(prompt, &color) + +// Assuming that the user chose "red - My favorite color": +fmt.Println(color) //=> "red" ``` ### MultiSelect