我想执行一些额外的步骤来初始化我的实现中的数据结构UnmarshalJSON.json.Unmarshal(b, type)当然,在该实现中调用会导致堆栈溢出.
如果有一个自定义UnmarshalJSON实现,那么JSON解码器会不断尝试查找json.Unmarshal.
还有另一种方法吗?只是调用底层的默认实现而不导致这个?
阅读这个https://github.com/go-pg/pg/wiki/Writing-Queries#select我看到很多次这个表达式:
(*Book)(nil)
Run Code Online (Sandbox Code Playgroud)
例子:
count, err := db.Model((*Book)(nil)).Count()
Run Code Online (Sandbox Code Playgroud)
这是什么意思?