Starting to goof around with binary search
which lead into goofing around with IO streams...
This commit is contained in:
parent
631472da41
commit
8ca6f624d4
@ -1,8 +1,9 @@
|
|||||||
CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":")
|
CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":")
|
||||||
GOPATH := $(PWD):$(CLEAN_GOPATH)
|
GOPATH := $(PWD):$(CLEAN_GOPATH)
|
||||||
PACKAGES := \
|
PACKAGES := $(foreach pkg,\
|
||||||
meatballhat.com/algs4 \
|
$(shell ls src/meatballhat.com),\
|
||||||
meatballhat.com/algs4-gcd
|
$(patsubst %,meatballhat.com/%,$(pkg))\
|
||||||
|
)
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
go test $(PACKAGES)
|
go test $(PACKAGES)
|
||||||
|
19
algs4/src/meatballhat.com/algs4-binarysearch/main.go
Normal file
19
algs4/src/meatballhat.com/algs4-binarysearch/main.go
Normal file
@ -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))
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user