summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/food-chain/food_chain.go9
1 files changed, 3 insertions, 6 deletions
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",
}