SETUP 625 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. echo "0. Ensure that protoc is installed."
  3. if which protoc; then
  4. echo "OK"
  5. else
  6. echo "Please install protoc and be sure that it is in your search path."
  7. exit
  8. fi
  9. echo "1. Set gopath and search path"
  10. export GOPATH=`pwd`/go
  11. export PATH=$GOPATH/bin:$PATH
  12. echo "2. Get the Go plugin for protoc"
  13. go get -a github.com/golang/protobuf/protoc-gen-go
  14. echo "3. Run protoc to generate the test API code"
  15. mkdir -p go/src/sample
  16. protoc sample.proto --proto_path=. --go_out=plugins=grpc:go/src/sample -osample.out
  17. echo "4. Get the writer dependencies"
  18. go get writer
  19. echo "5. Build the writer"
  20. go build writer