awesome-patterns/idiom/iota_const/main.go

23 lines
377 B
Go
Raw Normal View History

2018-01-19 02:28:56 +03:00
package main
import "github.com/davecgh/go-spew/spew"
type FeedLockLinkType int
const (
Racing FeedLockLinkType = iota
Market
)
var feedLockLinkTypes = [...]string{
"racing.Races.raceID",
"racing.Markets.marketID",
}
func (f FeedLockLinkType) String() string { return feedLockLinkTypes[f] }
func main() {
2018-01-19 08:17:32 +03:00
test := FeedLockLinkType(Racing).String()
2018-01-19 02:28:56 +03:00
spew.Dump(test)
}