diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2015-10-23 19:38:11 +0200 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2015-10-27 21:40:57 +0100 |
commit | 52f3c395ace14cbac92c3a8a96b5d5a241b844c4 (patch) | |
tree | 325046a7c625336afacae298b7d65343a62989a8 | |
parent | 03f3bf552bc3101bcb443f65ddf0b4f434a233e5 (diff) |
Remove keyword global
-rw-r--r-- | gwic.go | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -69,7 +69,7 @@ func feedworkers(wlist []*work, w string) []*work { return ret } -func printqueue(q *queue, words chan string, left int, out chan string) { +func printqueue(q *queue, words chan string, kw string, left int, out chan string) { var hungryhippos []*work for w := range words { @@ -99,16 +99,13 @@ func printqueue(q *queue, words chan string, left int, out chan string) { close(out) } -var ( - tw *tabwriter.Writer - kw string -) +var tw *tabwriter.Writer const MAX int = 11 func main() { flag.Parse() - kw = flag.Arg(0) + kw := flag.Arg(0) if len(kw) == 0 { fmt.Printf("Need string to search for. Exiting...\n") os.Exit(1) @@ -139,7 +136,7 @@ func main() { close(c) }(sc) - go printqueue(&q, sc, 5, out) + go printqueue(&q, sc, kw, 5, out) for l := range out { fmt.Fprintf(tw, "%s\n", l) |