我试图表示一个简化的染色体,它由N个碱基组成,每个碱基只能是{A,C,T,G}之一。我想用枚举形式化约束,但我想知道在Go中模拟枚举最惯用的方式是什么。 最佳答案 引用语言规范:IotaWithinaconstantdeclaration,thepredeclaredidentifieriotarepresentssuccessiveuntypedintegerconstants.Itisresetto0wheneverthereservedwordconstappearsinthesourceandincrementsaftere