From 8657f385c4e3de02625c584560f11b3186fc64b2 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 4 May 2017 12:36:20 +0200 Subject: [PATCH] examples: corrections requested by gitmetalinter Signed-off-by: deadprogram --- examples/firmata_travis.go | 2 +- examples/sphero_conways.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/firmata_travis.go b/examples/firmata_travis.go index 1aca8a3a..89fa68f3 100644 --- a/examples/firmata_travis.go +++ b/examples/firmata_travis.go @@ -49,10 +49,10 @@ func checkTravis(robot *gobot.Robot) { fmt.Printf("Checking repo %s/%s\n", user, name) turnOn(robot, "blue") resp, err := http.Get(fmt.Sprintf("https://api.travis-ci.org/repos/%s/%s.json", user, name)) - defer resp.Body.Close() if err != nil { panic(err) } + defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) diff --git a/examples/sphero_conways.go b/examples/sphero_conways.go index 14e13d95..353b7db6 100644 --- a/examples/sphero_conways.go +++ b/examples/sphero_conways.go @@ -78,7 +78,7 @@ func (c *conway) contact() { } func (c *conway) rebirth() { - fmt.Println("Welcome back", c.cell.Name, "!") + fmt.Println("Welcome back", c.cell.Name(), "!") c.life() } @@ -95,7 +95,7 @@ func (c *conway) life() { } func (c *conway) death() { - fmt.Println(c.cell.Name, "died :(") + fmt.Println(c.cell.Name(), "died :(") c.alive = false c.cell.SetRGB(255, 0, 0) c.cell.Stop() @@ -111,7 +111,7 @@ func (c *conway) enoughContacts() bool { func (c *conway) birthday() { c.age++ - fmt.Println("Happy birthday", c.cell.Name, "you are", c.age, "and had", c.contacts, "contacts.") + fmt.Println("Happy birthday", c.cell.Name(), "you are", c.age, "and had", c.contacts, "contacts.") if c.enoughContacts() { if !c.alive {