// RequestMethod defines http request method type RequestMethod int // Request methods const ( GET RequestMethod = iota POST ) func (rm RequestMethod) String() string { switch rm { case GET: return "GET" case POST: return "POST" default: return "Unknown" } } まずint型の別名としてtypeを設定する constのブロックの中でiotaを呼ぶと上から連番で0,1,2...と振ってくれる iotaの応用は https://splice.com/blog/iota-elegant-constants-golang/ が詳しい そのままだとP
