Project description goes here
brew install golang
brew upgrade golang
brew install dep
export GOPATH=$HOME/go # don't forget to change your path correctly!
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
2a. reload bash profile:
source ~/.bash_profile
go get -u github.com/alecthomas/gometalinter
gometalinter --install
5b. Install VS Code direnv extension (this allows our environment variables to be loaded for in-editor tests/builds/runs/etc.).
git clone [email protected]:b-lab-org/impact-go.git $GOPATH/src/github.com/b-lab-org/impact-go
Ensure the impact-api environment is running - impact-go depends on this to start the impact_go_test db for testing, and shares the impact db for running the app locally.
Run the tests (depends on db running from the php app)
cd $GOPATH/src/github.com/b-lab-org/impact-go
dep ensure
go test -p=1 ./...
cd $GOPATH/src/github.com/b-lab-org/impact-go
./serve.sh
this will kick off a watcher that restarts the go service whenever code changes are detected.
cd $GOPATH/src/github.com/b-lab-org/impact-go/cmd/serve
go run serve.go
For a quick start of the language: https://tour.golang.org/
To point to another database and run a series of items through scoring:
DATABASE_URL=postgres://xxx:xxxxx@xxxxx/xxxx; time psql $DATABASE_URL -c "select '-a ' || id from assessment__c where survey_num__c > 70 limit 100" -t | xargs go run score.go -responseDiffThreshold 0.001 -aggregateDiffThreshold 0.001 -persist=false
Content type
Image
Digest
Size
175.5 MB
Last updated
about 8 years ago
docker pull impactbot/impact-go