()
| 115 | } |
| 116 | |
| 117 | func generateCountries() ([]byte, error) { |
| 118 | tmpl, err := template.New("countries.tstmpl").Parse(countriesTemplate) |
| 119 | if err != nil { |
| 120 | return nil, xerrors.Errorf("parse template: %w", err) |
| 121 | } |
| 122 | |
| 123 | var out bytes.Buffer |
| 124 | err = tmpl.Execute(&out, codersdk.Countries) |
| 125 | if err != nil { |
| 126 | return nil, xerrors.Errorf("execute template: %w", err) |
| 127 | } |
| 128 | |
| 129 | return out.Bytes(), nil |
| 130 | } |
| 131 | |
| 132 | func pascalCaseName[T ~string](name T) string { |
| 133 | names := strings.Split(string(name), "_") |