added fuel for chapter nine

This commit is contained in:
John O'Keefe 2024-01-16 10:21:57 -05:00
parent eeda65afea
commit 34b69520f3
2 changed files with 22 additions and 0 deletions

16
playground/fuel.go Normal file
View File

@ -0,0 +1,16 @@
// part of chapter 9
package main
import "fmt"
type Liters float64
type Gallons float64
func fuel() {
var carFuel Gallons
var busFuel Liters
carFuel = Gallons(10.0)
busFuel = Liters(240.0)
fmt.Println(carFuel, busFuel)
}

View File

@ -104,6 +104,12 @@ func main() {
magazineSubscribers()
},
},
{
name: "Fuel",
launchFunction: func() {
fuel()
},
},
}
menu := wmenu.NewMenu("Choose a program.")
menu.Action(func(opts []wmenu.Opt) error {