when i build project, error happen . show defined template file err:
cannot use ModelType(GlobalmgDb) (value of type ModelType) as data_cache.CreateRes value in argument to append: ModelType does not implement data_cache.CreateRes (missing method Create)
i want to define function with generic.Type define. for example: define template_demo.go :
func registerModelType() { MngCreater = append(MngCreater, ModelType(GlobalmgDb)) }
input_file="./template_res_register.go" out_file="res_register_1.go" ## real_type="RegisterSignDailyFortuneMg,RegisterSecretChitchatWork" ###RegisterSecretChitchatWork pkg_name="common_res" genny -in ${input_file} -out ${out_file} -pkg ${pkg_name} gen "ModelType=${real_type}"
func registerRegisterSecretChitchatWork() { MngCreater = append(MngCreater, RegisterSecretChitchatWork(GlobalmgDb)) }
cannot use ModelType(GlobalmgDb) (value of type ModelType) as data_cache.CreateRes value in argument to append: ModelType does not implement data_cache.CreateRes (missing method Create)