Minimal CRUD in Go with Gin framework
- Install Go
- Add the GOPATH to
.bash_profile
;export GOPATH=~/go
- Install the package manager:
sudo apt install go-dep
- Add and enter the project path:
mkdir -p $GOPATH/src/github.com/go-crud cd $GOPATH/src/github.com/go-crud
- Init the project
dep init
(needs a dummy Go file in the root) - Install the project dependencies:
dep ensure
- Or add new ones:
dep ensure -add github.com/some/project
- Update existing ones:
dep ensure -update
- Or add new ones:
- Start the project with
go run main.go
- Browse to http://localhost:8080/v1/hello