From 8c55bc1c74888fa293ef16fd3696dd10c5f89263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 23 May 2022 14:46:38 +0200 Subject: [PATCH] Fix README formatting for select descriptions --- 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