Golang map 出现 cannot call pointer method Load on _ 网 - Assbbs

Golang map 出现 cannot call pointer method Load on 网上还没有找到类似解决方法。 只需要在map创建时,将内部struct改为引用。 myMap := make map string struct string 再向内部元素赋值一个空结构引用。 myMap "123" = &struct string {…

Golang map 出现 cannot call pointer method Load on 网上还没有找到类似解决方法。 只需要在map创建时,将内部struct改为引用。 myMap := make map string struct string 再向内部元素赋值一个空结构引用。 myMap "123" = &struct string {} 即可解决问题。