From 8ca6f624d4e16264bad0e9b1239c2a2a6f36c2bf Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 18 Nov 2012 08:30:49 -0500 Subject: [PATCH] Starting to goof around with binary search which lead into goofing around with IO streams... --- algs4/Makefile | 7 ++++--- .../algs4-binarysearch/main.go | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 algs4/src/meatballhat.com/algs4-binarysearch/main.go diff --git a/algs4/Makefile b/algs4/Makefile index fa5000b..abd2c63 100644 --- a/algs4/Makefile +++ b/algs4/Makefile @@ -1,8 +1,9 @@ CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":") GOPATH := $(PWD):$(CLEAN_GOPATH) -PACKAGES := \ - meatballhat.com/algs4 \ - meatballhat.com/algs4-gcd +PACKAGES := $(foreach pkg,\ + $(shell ls src/meatballhat.com),\ + $(patsubst %,meatballhat.com/%,$(pkg))\ + ) test: build go test $(PACKAGES) diff --git a/algs4/src/meatballhat.com/algs4-binarysearch/main.go b/algs4/src/meatballhat.com/algs4-binarysearch/main.go new file mode 100644 index 0000000..170f1b6 --- /dev/null +++ b/algs4/src/meatballhat.com/algs4-binarysearch/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" +) + +func main() { + whiteListTxt, err := ioutil.ReadAll(os.Stdin) + + if err != nil { + fmt.Println("UGH: ", err) + os.Exit(1) + } + + fmt.Println("YAP") + fmt.Println("Got: ", string(whiteListTxt)) +}