type Weekday string
const (
Sunday Weekday = "Sunday"
Monday Weekday = "Monday"
)
func main() {
fmt.Println(Sunday)
}type weekday uint
const ( Sunday weekday = iota Monday)
var weekdayNames = [...]string{"Sunday", "Monday"}
func (day weekday) String() string { return weekdayNames[day]}
func main() {
fmt.Println(Sunday)
}
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/mbHdiXkb7iU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
|
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.