You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt""github.com/pterm/pterm"
)
funcmain() {
// Initialize an empty slice to hold the optionsvaroptions []string// Generate 100 options and add them to the options slicefori:=0; i<100; i++ {
options=append(options, fmt.Sprintf("Option %d", i))
}
// Generate 5 additional options with a specific message and add them to the options slicefori:=0; i<5; i++ {
options=append(options, fmt.Sprintf("You can use fuzzy searching (%d)", i))
}
// Use PTerm's interactive select feature to present the options to the user and capture their selection// The Show() method displays the options and waits for the user's inputselectedOption, _:=pterm.DefaultInteractiveSelect.WithOptions(options).Show()
// Display the selected option to the user with a green color for emphasispterm.Info.Printfln("Selected option: %s", pterm.Green(selectedOption))
}