$ sh setupRun.sh
// Wait for like 30 sec til these servers fully start up
$ go run DBMigrate.go
-
Dependencies management tool: https://golang.github.io/dep/
-
Write DOCKERFILE https://stackoverflow.com/questions/47837149/build-docker-with-go-app-cannot-find-package/47837312 (Second answer is helpful)
https://blog.golang.org/docker
Example
$ dep ensure -add github.com/foo/bar github.com/baz/quux
$ docker run -p 8080:8080 dockertest
Server will be exposed at localhost:8080
Login to local postgres
$ psql -d postgres -U postgres
Show table
$ \dt
List listening port
$ netstat -ap tcp | grep -i "listen"
lsof -n -i4TCP:8080
start local postgres with brew
$ brew services start postgresql
$ brew services stop postgresql
Find running process in 5432
sudo lsof -i :5432
- Does gorm prevent sql injection? https://github.com/jinzhu/gorm/issues/152
- Remove hard code username/password
-
- Associate id with github token