code: func createGenerateStruct(apiDef *raml.APIDefinition, tip, dir, pkgName string) (string, error) {
  	rt := raml.Type{
  		Type: tip,
  	}
  	if parents, isMultiple := rt.MultipleInheritance(); isMultiple {
  		sd := newStructDef(apiDef, multipleInheritanceNewName(parents), pkgName, "", map[string]interface{}{})
  		sd.addMultipleInheritance(apiDef, parents)
  		return sd.Name, sd.generate(dir)
  	}
  
  	if rt.IsUnion() {
  		t := raml.Type{
  			Type: tip,
  		}
  		sd := newStructDef(apiDef, unionNewName(tip), pkgName, "", map[string]interface{}{})
  		sd.T = t
  		sd.buildUnion()
  		sd.generate(dir)
  	}
  	return "", nil
  }
docs: // create struct and generate it if possible.
  // return:
  // - newType Name if we try to generate it
  // - nil if no error happened during generation