var typeNames … var genTypes … func findTypeNames(model *Model) { … } // nameType populates typeNames[t] with the computed name of the type. // path is the list of enclosing constructs in the JSON model. func nameType(t *Type, path []string) string { … } func nameFromPath(prefix string, path []string) string { … }