·
Let's go
const (
	read   = 1 << iota // 00000001 = 1
	write              // 00000010 = 2
	remove             // 00000100 = 4

	// admin will have all of the permissions
	admin = read | write | remove
)

基本上就是枚举的用途,设计的时候就是这样用的,没其他了

Replies
1

好哒!谢谢