Reformat examples using gofmt
This commit is contained in:
parent
7a1e5c4c8b
commit
6cd2c585b8
|
@ -1,37 +1,37 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
. "gobot"
|
||||
"time"
|
||||
. "gobot"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
beaglebone := new(Beaglebone)
|
||||
beaglebone.Name = "Beaglebone"
|
||||
beaglebone := new(Beaglebone)
|
||||
beaglebone.Name = "Beaglebone"
|
||||
|
||||
led := NewLed(beaglebone)
|
||||
led.Driver = Driver{
|
||||
Name: "led",
|
||||
Pin: "P9_12",
|
||||
}
|
||||
led := NewLed(beaglebone)
|
||||
led.Driver = Driver{
|
||||
Name: "led",
|
||||
Pin: "P9_12",
|
||||
}
|
||||
|
||||
connections := []interface{} {
|
||||
beaglebone,
|
||||
}
|
||||
devices := []interface{} {
|
||||
led,
|
||||
}
|
||||
connections := []interface{}{
|
||||
beaglebone,
|
||||
}
|
||||
devices := []interface{}{
|
||||
led,
|
||||
}
|
||||
|
||||
work := func(){
|
||||
Every(1000 * time.Millisecond, func(){ led.Toggle() })
|
||||
}
|
||||
|
||||
robot := Robot{
|
||||
Connections: connections,
|
||||
Devices: devices,
|
||||
Work: work,
|
||||
}
|
||||
work := func() {
|
||||
Every(1000*time.Millisecond, func() { led.Toggle() })
|
||||
}
|
||||
|
||||
robot.Start()
|
||||
robot := Robot{
|
||||
Connections: connections,
|
||||
Devices: devices,
|
||||
Work: work,
|
||||
}
|
||||
|
||||
robot.Start()
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
. "gobot"
|
||||
"time"
|
||||
"fmt"
|
||||
"fmt"
|
||||
. "gobot"
|
||||
"time"
|
||||
)
|
||||
|
||||
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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue