草庐IT

mapStructResult

全部标签

mongodb - 将动态数组结构传递给函数 Golang

我想创建接受“动态数组结构”的函数,并使用它映射来自数据库*mgodb的数据typeCatsstruct{Meowstring}funcgetCatsPagination(){mapStructResult("Animality","Cat_Col",Cats)}typeDogsstruct{Barkstring}funcgetDogsPagination(){mapStructResult("Animality","Dog_Col",Dogs)}funcmapStructResult(dbstring,collectionstring,modelinterface{}){result

mongodb - 将动态数组结构传递给函数 Golang

我想创建接受“动态数组结构”的函数,并使用它映射来自数据库*mgodb的数据typeCatsstruct{Meowstring}funcgetCatsPagination(){mapStructResult("Animality","Cat_Col",Cats)}typeDogsstruct{Barkstring}funcgetDogsPagination(){mapStructResult("Animality","Dog_Col",Dogs)}funcmapStructResult(dbstring,collectionstring,modelinterface{}){result