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

Function generateCountries

scripts/typegen/main.go:117–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115}
116
117func 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
132func pascalCaseName[T ~string](name T) string {
133 names := strings.Split(string(name), "_")

Callers 1

mainFunction · 0.85

Calls 5

ParseMethod · 0.65
NewMethod · 0.65
ExecuteMethod · 0.65
ErrorfMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected