added fuel for chapter nine
This commit is contained in:
parent
eeda65afea
commit
34b69520f3
16
playground/fuel.go
Normal file
16
playground/fuel.go
Normal 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)
|
||||||
|
}
|
@ -104,6 +104,12 @@ func main() {
|
|||||||
magazineSubscribers()
|
magazineSubscribers()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Fuel",
|
||||||
|
launchFunction: func() {
|
||||||
|
fuel()
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
menu := wmenu.NewMenu("Choose a program.")
|
menu := wmenu.NewMenu("Choose a program.")
|
||||||
menu.Action(func(opts []wmenu.Opt) error {
|
menu.Action(func(opts []wmenu.Opt) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user