Closed Sgmwei closed 5 months ago
On 9 April 2024 11:32:02 CEST, Sgmwei @.***> wrote:
darwin/arm64 (macbook m1 air) golang1.21.8
type ( IDo interface { Do() error } Struct1 struct{} ) func (Struct1) Do() error {
The receiver needs a name, not only a type.
fmt.Print("DO SOMETHING\n") return nil }
func NewStructX() IDo { return Struct1{} }
加载上述测试文件将报错`unresolve external:type:error`
--
Liebe Grüße 🙋🏼♂️
Matthias
--
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
http://www.asciiribbon.org/
not only a type. …
Tks for pointing out my grammar is not complete, but this does not affect the occurrence of errors.
by the way, goloader 's version is github.com/pkujhd/goloader v0.0.0-20240302083706-9af26f1bc5bc
, and the occurrence happend at addSymbolMap (/github.com/pkujhd/goloader@v0.0.0-20240302083706-9af26f1bc5bc/ld.go:378
) when i debug symPtr
can't find the key 'type:error', which in linker.SymMap
need to use.
Seems to work on my fork… https://github.com/eh-steve/goloader/commit/d53913edf861c452828b98a17f9e1f5976c61505
Seems to work on my fork… eh-steve@d53913e
When registering a type without a package name, registerType() will resolve its name. but when this type is an interface, it get a different name. type:error is an internal interface without a package name. registerType get a wrong name("Interface { Error() string }") @eh-steve Steve's fork works because this version will attempt to handle undefined symbols. It copys type:error from runtime.a again.
Seems to work on my fork… eh-steve@d53913e
When registering a type without a package name, registerType() will resolve its name. but when this type is an interface, it get a different name. type:error is an internal interface without a package name. registerType get a wrong name("Interface { Error() string }") @eh-steve Steve's fork works because this version will attempt to handle undefined symbols. It copys type:error from runtime.a again.
So what's your suggest if I want to continue using your branch ?😯
darwin/arm64 (macbook m1 air) golang1.21.8
加载上述测试文件将报错
unresolve external:type:error