【发布时间】:2018-06-20 13:14:02
【问题描述】:
最近我开始学习 go-ethereum,这是我第一次使用 golang。 C++ 是我的主要语言,由于 go-ethereum 项目中的变量名,我有点困惑。
core/state/managed_state.go:25:type account struct {
core/state/state_object.go:98:type Account struct {
state包中同时存在“account”和“Account”两种类型,看起来很奇怪。
我检查了Naming convention for similar Golang variables,但它看起来仍然很糟糕。
我发现他们在不同的包中使用了很多“节点”结构。当然,它们确实有不同的目的和结构。
这些命名在 golang 中是约定俗成的吗? 如果您对 golang 中的命名约定有任何好的参考(例如开源项目或书籍),您能说出其中的一些吗?将不胜感激。
【问题讨论】:
标签: go naming-conventions