You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
653 B
57 lines
653 B
package quartermaster
|
|
|
|
type Unit int
|
|
|
|
const (
|
|
Teaspoon Unit = iota
|
|
Tablespoon
|
|
Cup
|
|
Ounce
|
|
Gram
|
|
Pound
|
|
Individual
|
|
)
|
|
|
|
func (u Unit) String() string {
|
|
switch u {
|
|
case Teaspoon:
|
|
return "Teaspoon"
|
|
case Tablespoon:
|
|
return "Tablespoon"
|
|
case Cup:
|
|
return "Cup"
|
|
case Ounce:
|
|
return "Ounce"
|
|
case Gram:
|
|
return "Gram"
|
|
case Pound:
|
|
return "Pound"
|
|
case Individual:
|
|
return "Individual"
|
|
}
|
|
return "Unknown"
|
|
}
|
|
|
|
type VitaminType int
|
|
|
|
const (
|
|
A VitaminType = iota
|
|
B
|
|
C
|
|
Iron
|
|
)
|
|
|
|
func (v VitaminType) String() string {
|
|
switch v {
|
|
case A:
|
|
return "A"
|
|
case B:
|
|
return "B"
|
|
case C:
|
|
return "C"
|
|
case Iron:
|
|
return "Iron"
|
|
}
|
|
return "Unknown"
|
|
}
|