在reflect包里面有個方法
// resolveNameOff resolves a name offset from a base pointer.
// The (*Rtype).nameOff method is a convenience wrapper for this function.
// Implemented in the runtime package.
func resolveNameOff(ptrInModule unsafe.Pointer, off int32) unsafe.Pointer
這里只有宣告沒有實作,注釋上說實作在runtime。不解的問題是,兩個不同的包也沒有import,為什么reflect內部就能參考runtime內的方法呢?
假如我也想參考,錯誤顯示:沒有函式體實作。。這個問題主要是想問,語言對系統包內部是怎么處理的?會有特殊對待嗎?
只有20分都送上,求解答
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/270055.html
標籤:go語言
