英文: Is there any good way to define Monoid interface? 问题 我想定义一个类似于"Monoid"的结构体。(这是一个在群论中出现...
将结构体指针分配给接口指针
英文: Assign struct pointer to interface pointer 问题 我正在尝试重构一些 Golang 源代码,并且想使用接口,但我遇到了很大的困难(请原谅,我是一个彻头...
调用在目录的不同部分定义的方法到任何你想要的地方。
英文: Calling methods defined in different parts of the directory to wherever you want 问题 我正在努力解决一个问题,...
在Go语言中,是否可以使用接口复合字面量?
英文: Is it possible to have interface composite literals in Go? 问题 我只想确认一下我对interface{}{}的理解是否正确。 int...
JSON转Excel转换,使用Go语言的映射数据结构,每次输出的结果都不相同。
英文: JSON to Excel conversion, by using go lang map data structure does not produce same output every...
如何在Go中使用指针作为集合类型的内部数据结构来实现接口?
英文: How to use pointers to interface in go as internal data structure for collection-like types? 问题 ...
在Go语言中,为什么要在函数上实现接口?
英文: Why would you implement an interface on a function in Go? 问题 我正在阅读关于Go语言中函数如何实现接口的内容(例如这个例子或这个例子...
接口的混淆问题
英文: Confusion with interfaces 问题 我正在使用Go语言编写一个解析器,并且有以下用于构建抽象语法树的代码: type NODE interface { GetPositi...
在接口内部访问结构体的值
英文: Access struct values inside an interface 问题 我有一个类似的interface{},如下所示: Rows interface{} 在Rows接口中,我...
Is it possible to have Optional methods inside the interface in golang?
英文: Is it possible to have Optional methods inside the interface in golang? 问题 我想为接口创建可选的perim方法。这可能...
56