Custom string types in Go

前端 未结 0 758
温柔的废话
温柔的废话 2020-12-24 09:30

How can I create a custom type in Go that is restricted to a certain list of string values? e.g.

type Suit = "Spade" | "Diamond" | "C         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题