golang函数引用的坑

版权声明:本文为原创文章,未经允许不得转载 https://blog.csdn.net/qq_33875256/article/details/84839843

函数引用时必须声明别名

var house models.House
index,err := house.HouseGetIndex()

直接调用会报错

index,err := models.House.HouseGetIndex()

错误:

not enough arguments in call to models.House.HouseGetIndex less... (Ctrl+F1) 
Inspection info: This inspection checks function calls.

猜你喜欢

转载自blog.csdn.net/qq_33875256/article/details/84839843
今日推荐