From 6cd2c585b804aed6e325d390de7042e6fab60d3a Mon Sep 17 00:00:00 2001 From: deadprogram Date: Wed, 13 Nov 2013 20:47:21 -0800 Subject: [PATCH] Reformat examples using gofmt --- examples/blink.go | 50 +++++++++++++++++++++++------------------------ examples/hello.go | 20 +++++++++---------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/blink.go b/examples/blink.go index 6a36078a..086236de 100644 --- a/examples/blink.go +++ b/examples/blink.go @@ -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() } diff --git a/examples/hello.go b/examples/hello.go index a858617c..01e3b5ad 100644 --- a/examples/hello.go +++ b/examples/hello.go @@ -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() }