Sign inSign up

impactbot/impact-go

By impactbot

•Updated about 8 years ago

impact scoring service

Image
0

4.2K

impactbot/impact-go repository overview

⁠impact-go Build Status

Project description goes here

⁠Get Started

  1. Install the latest golang:
brew install golang
brew upgrade golang
  1. Install dep⁠
brew install dep
  1. Add the following to the end of ~/.bash_profile:
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
  1. Install gometalinter
go get -u github.com/alecthomas/gometalinter
gometalinter --install
  1. Recommended - Install VS Code, and Go extension

5b. Install VS Code direnv extension (this allows our environment variables to be loaded for in-editor tests/builds/runs/etc.).

  1. Clone the project:
git clone [email protected]:b-lab-org/impact-go.git $GOPATH/src/github.com/b-lab-org/impact-go
  1. 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.

  2. 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 ./...
  1. Start the watcher:
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.

⁠Run the web server directly

cd $GOPATH/src/github.com/b-lab-org/impact-go/cmd/serve
go run serve.go

⁠Resources

For a quick start of the language: https://tour.golang.org/⁠

⁠Helpful commands

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

Tag summary

Content type

Image

Digest

Size

175.5 MB

Last updated

about 8 years ago

docker pull impactbot/impact-go