1. 程式人生 > >golang函式引用的坑

golang函式引用的坑

函式引用時必須宣告別名

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.