Reformat examples using gofmt

This commit is contained in:
deadprogram 2013-11-13 20:47:21 -08:00
parent 7a1e5c4c8b
commit 6cd2c585b8
2 changed files with 35 additions and 35 deletions

View File

@ -1,37 +1,37 @@
package main package main
import ( import (
. "gobot" . "gobot"
"time" "time"
) )
func main() { func main() {
beaglebone := new(Beaglebone) beaglebone := new(Beaglebone)
beaglebone.Name = "Beaglebone" beaglebone.Name = "Beaglebone"
led := NewLed(beaglebone) led := NewLed(beaglebone)
led.Driver = Driver{ led.Driver = Driver{
Name: "led", Name: "led",
Pin: "P9_12", Pin: "P9_12",
} }
connections := []interface{} { connections := []interface{}{
beaglebone, beaglebone,
} }
devices := []interface{} { devices := []interface{}{
led, led,
} }
work := func(){ work := func() {
Every(1000 * time.Millisecond, func(){ led.Toggle() }) Every(1000*time.Millisecond, func() { led.Toggle() })
} }
robot := Robot{
Connections: connections,
Devices: devices,
Work: work,
}
robot.Start() robot := Robot{
Connections: connections,
Devices: devices,
Work: work,
}
robot.Start()
} }

View File

@ -1,18 +1,18 @@
package main package main
import ( import (
. "gobot" "fmt"
"time" . "gobot"
"fmt" "time"
) )
func main() { func main() {
robot := Robot{
Work: func(){
Every(300 * time.Millisecond, func(){ fmt.Println("Greetings human") })
},
}
robot.Start() robot := Robot{
Work: func() {
Every(300*time.Millisecond, func() { fmt.Println("Greetings human") })
},
}
robot.Start()
} }