From fa349bb17f2aa1c5d3c7c25b3faa1213a24d9bcd Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 25 Aug 2016 16:51:51 +0200 Subject: Cleanup --- go/food-chain/food_chain.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'go') diff --git a/go/food-chain/food_chain.go b/go/food-chain/food_chain.go index 9e5494d..c42ebbc 100644 --- a/go/food-chain/food_chain.go +++ b/go/food-chain/food_chain.go @@ -9,8 +9,7 @@ import ( const testVersion = 2 const lyrics = `I know an old lady who swallowed a {{.Animal}}. -{{- if eq .Animal "fly"}} -{{- else if eq .Animal "spider"}} +{{- if eq .Animal "spider"}} It wriggled and jiggled and tickled inside her. {{- else if eq .Animal "bird"}} How absurd to swallow a bird! @@ -24,9 +23,8 @@ Just opened her throat and swallowed a goat! I don't know how she swallowed a cow! {{- end}} {{- range .Animals}} -She swallowed the {{.A}} to catch the {{if eq .B "spider" -}} -spider that wriggled and jiggled and tickled inside her{{else -}} -{{.B}}{{end}}.{{end}} +She swallowed the {{.A}} to catch the {{.B}}{{if eq .B "spider"}} that wriggled and jiggled and tickled inside her{{end}}. +{{- end}} {{- if eq .Animal "horse"}} She's dead, of course! {{- else}} @@ -34,7 +32,6 @@ I don't know why she swallowed the fly. Perhaps she'll die. {{- end}}` var animals = []string{ - //"horse", "cow", "goat", "dog", "cat", "bird", "spider", "fly", "fly", "spider", "bird", "cat", "dog", "goat", "cow", "horse", } -- cgit v1.2.3