MCPcopy Index your code
hub / github.com/coder/coder / promptCountry

Function promptCountry

cli/login.go:627–642  ·  view source on GitHub ↗
(inv *serpent.Invocation)

Source from the content-addressed store, hash-verified

625}
626
627func promptCountry(inv *serpent.Invocation) (string, error) {
628 options := make([]string, len(codersdk.Countries))
629 for i, country := range codersdk.Countries {
630 options[i] = country.Name
631 }
632
633 selection, err := cliui.Select(inv, cliui.SelectOptions{
634 Options: options,
635 Message: "Select the country:",
636 HideSearch: false,
637 })
638 if err != nil {
639 return "", xerrors.Errorf("select country: %w", err)
640 }
641 return selection, nil
642}

Callers 1

loginMethod · 0.85

Calls 2

SelectFunction · 0.92
ErrorfMethod · 0.45

Tested by

no test coverage detected