Go:常量

By kcersing , 14 一月, 2020

import (
   "testing"
)
//产量定义
const (
   Monday = iota + 1
   Tuesday
   Wednesday
   Thursday
   Friday
   Saturday
   Sunday
)
const (
   Readable =1<<iota
   Writable
   Executable

)
func TestConstantTry(t *testing.T) {

   t.Log(Monday, Sunday)
}
func TestConstantTry2(t *testing.T) {

   a:=1
   t.Log(a&Readable==Readable ,a&Writable==Writable ,a&Executable==Executable )

}


标签