什么是惯用语言?
// Present tense
type MyStruct struct {
IsExpired bool
}
// Perfect tense (? i don't know my tenses)
type MyStruct struct {
Expired bool
}
// Present tense but flipped
type MyStruct struct {
NotExpired bool
}
我真的在为go的命名约定苦苦挣扎。我发现很难推理出正确的命名方式。我的直觉说Expired
,但我认为其他人会说IsExpired
。