()
| 10 | ) |
| 11 | |
| 12 | func main() { |
| 13 | var b bytes.Buffer |
| 14 | err := template.Must( |
| 15 | template.New("helpers"). |
| 16 | Funcs(template.FuncMap{ |
| 17 | "cases": func(op string) string { return cases(op, uints, ints, floats) }, |
| 18 | "cases_int_only": func(op string) string { return cases(op, uints, ints) }, |
| 19 | "cases_with_duration": func(op string) string { |
| 20 | return cases(op, uints, ints, floats, []string{"time.Duration"}) |
| 21 | }, |
| 22 | "array_equal_cases": func() string { return arrayEqualCases([]string{"string"}, uints, ints, floats) }, |
| 23 | }). |
| 24 | Parse(helpers), |
| 25 | ).Execute(&b, nil) |
| 26 | if err != nil { |
| 27 | panic(err) |
| 28 | } |
| 29 | |
| 30 | formatted, err := format.Source(b.Bytes()) |
| 31 | if err != nil { |
| 32 | panic(err) |
| 33 | } |
| 34 | fmt.Print(string(formatted)) |
| 35 | } |
| 36 | |
| 37 | var ints = []string{ |
| 38 | "int", |
nothing calls this directly
no test coverage detected
searching dependent graphs…