避免参数语义不明确
// bad usage
printInfo("foo", true, true)
// good usage
printInfo("foo", true /* isLocal */, true /* done */)type Region int
const (
UnknownRegion Region = iota + 1
Local
)
type Status int
const (
StatusReady = iota + 1
StatusDone
// Maybe we will have a StatusInProgress in the future.
)
func printInfo(name string, region Region, status Status)Last updated