I have
const (
BlahFoo = 1 << iota
MooFoo
)
then
type Cluster struct {
a int
b int
}
I want Cluster.a to only be BlahFoo or MooFoo
How do I enforce that?
I have
const (
BlahFoo = 1 << iota
MooFoo
)
then
type Cluster struct {
a int
b int
}
I want Cluster.a to only be BlahFoo or MooFoo
How do I enforce that?
type FooEnum int
const (
BlahFoo FooEnum = 1 << iota
MooFoo
)
type Cluster struct {
a FooEnum
b int
}