英文: How to unite two different struct using interface? 问题 我有以下代码: package main import ( "log"...
Golang DDD(领域驱动设计)的依赖模块实现
英文: Golang DDD implementation of dependent modules 问题 我正在尝试将DDD架构应用到我的应用程序模块中,并在存储它们之间的相似(依赖)结构的问题上遇...
Golang:将结构体转换为偏移量为0的嵌入式结构体。
英文: Golang: convert struct to embedded at offset 0 struct 问题 我有一些不同的结构体,比如Big,其中包含在偏移量0处嵌入的Small结构体。...
将interface{}转换为int时出错 go-gin
英文: Error converting interface{} to int go-gin 问题 我从*gin.Context接收到一个interface{}类型的值: c.MustGet(&quo...
依赖于接口的 Golang 接口
英文: golang interface that depends on interface 问题 我不确定这是否应该是两个独立的问题还是一个问题的两个部分,但在我看来,这是一个由两个部分组成的问题:...
有没有一种通用的方式来表示一组相似的函数?
英文: Is there a way to generically represent a group of similar functions? 问题 根据上面的代码,有没有一种方法可以使用映射或数...
在Golang中减少代码重复
英文: Reducing code duplication in Golang 问题 我在寻找解决代码重复问题的"Go方式"时遇到了困难。以下是问题的描述: type ( With...
Go – How to copy slice of an interface?
英文: Go - How to copy slice of an interface? 问题 我正在尝试使用辅助数组实现一个简单的归并排序。我有一个type byString []string,它实现...
你可以在Golang中编写一个接受多种类型作为参数的函数。
英文: How can I write a function in Golang which takes multiple types as a parameter? 问题 我正在尝试在Golang中...
确保嵌入的结构体实现接口而不引入歧义
英文: Ensuring embedded structs implement interface without introducing ambiguity 问题 我正在尝试通过更好地定义接口和使用...
56