func PromptChoose(prompt string, list []string) int {
	fmt.Println()
	for i, val := range list {
		fmt.Printf("  %d) %s\n", i+1, val)
	}

	fmt.Println()
	i := -1

	for {
		s := Prompt(prompt)
		// index
		n, err := strconv.Atoi(s)
		if err == nil {
			if n > 0 && n <= len(list) {
				i = n - 1
				break
			} else {
				continue
			}
		}

		// value
		i = indexOf(s, list)
		if i != -1 {
			break
		}
	}

	return i
}
// PromptChoose prompts for a single selection from `list`, returning in the index.
PromptChoose prompts for a single selection from `list`, returning in the index.
// PromptChoose prompts for a single selection from ` list ` returning in the index .
func PromptChoose(prompt string, list []string) int {
	fmt.Println()
	for i, val := range list {
		fmt.Printf("  %d) %s\n", i+1, val)
	}
	fmt.Println()
	i := -1
	for {
		s := Prompt(prompt)
		n, err := strconv.Atoi(s)
		if err == nil {
			if n > 0 && n <= len(list) {
				i = n - 1
				break
			} else {
				continue
			}
		}
		i = indexOf(s, list)
		if i != -1 {
			break
		}
	}
	return i
}
func PromptChoose ( prompt string , list [ ] string ) int { fmt . Println ( ) for i , val := range list { fmt . Printf ( " \n " , i + 1 , val ) } fmt . Println ( ) i := - 1 for { s := Prompt ( prompt ) n , err := strconv . Atoi ( s ) if err == nil { if n > 0 && n <= len ( list ) { i = n - 1 break } else { continue } } i = indexOf ( s , list ) if i != - 1 { break } } return i }
PromptChoose prompts for a single selection from `list`, returning in the index.
PromptChoose prompts for a single selection from ` list ` returning in the index .
// index // value