RosettaCodeData/Task/Enumerations/V-(Vlang)/enumerations-2.v
2024-10-16 18:07:41 -07:00

9 lines
235 B
V

mut color := Color.red
// V knows that `color` is a `Color`.
color = .green
println(color) // "green"
match color {
.red {println("the color was red")}
.green {println("the color was green")}
.blue {println("the color was blue")}
}