tracks/go/exercises/leap/.meta/gen.go in trackler-2.2.1.96 vs tracks/go/exercises/leap/.meta/gen.go in trackler-2.2.1.97
- old
+ new
@@ -20,12 +20,14 @@
// The JSON structure we expect to be able to unmarshal into
type js struct {
Cases []struct {
Description string
- Input int
- Expected bool
+ Input struct {
+ Year int
+ }
+ Expected bool
}
}
// template applied to above data structure generates the Go test cases
var tmpl = `package leap
@@ -35,8 +37,8 @@
var testCases = []struct {
year int
expected bool
description string
}{
-{{range .J.Cases}}{ {{.Input}}, {{.Expected}}, {{printf "%q" .Description}}},
+{{range .J.Cases}}{ {{.Input.Year}}, {{.Expected}}, {{printf "%q" .Description}}},
{{end}}}
`