When run README.md tutorial is done, i write this code after turorial:
for _, action := range plan {
switch a := action.(type) {
case *MyAction:
fmt.Println(a.Name)
switch a.Name {
case "eat":
// do something
case "sleep":
// do something
}
}
}
This right? and if i has more action (100+), the code will more long, has more good idea will quick do logical? thanks.
When run README.md tutorial is done, i write this code after turorial:
This right? and if i has more action (100+), the code will more long, has more good idea will quick do logical? thanks.