1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00
hybridgroup.gobot/examples/every_done.go
Marc-Antoine Ruel 50d5869808 Fix go test ./...
Make all examples to not be built by default by adding the build tag 'example'.
Some files were automatically reformatted by goimports upon saving.
2017-03-13 11:01:39 -04:00

31 lines
392 B
Go

// +build example
//
// Do not build by default.
package main
import (
"fmt"
"time"
"gobot.io/x/gobot"
)
func main() {
robot := gobot.NewRobot(
"hello",
func() {
done := gobot.Every(750*time.Millisecond, func() {
fmt.Println("Greetings human")
})
gobot.After(5*time.Second, func() {
done.Stop()
fmt.Println("We're done here")
})
},
)
robot.Start()
}