Last updated 2 years ago
类型断言的性能损耗
Type Assertion(断言)是用于interface value的一种操作,语法是x.(T) 类型断言的性能损耗
好在 vscode 有个非常好用的功能:Go to Implementation 「因為go to 定義可能會直接到介面 無法到實作,但可以用Go to Implementation找到實作內容喔!!!!!!」
Interface{} 多形 Interface,因此時常需要與Reflection 進行搭配
interface 繼承interface 也可以繼承別的 interface 的行為:
為什麼沒有類型繼承
附上