A basic project structure with configuration using environment variables and a convenient http client package to reduce boilerplate.
- Define configuration variables in
config/config.go
- Use the HTTP client with simple calls to
http.GET
andhttp.POST
- Clone this repository in a location from your GOPATH
- Replace all occurrences of
Vinelab/go-base
with the name yourvendor/project
Using Docker image vinelab/go-vndr
:
- Run
docker run -it -v /path/to/project:/go/src/github.com/[vendor]/[project] vinelab/go-vndr bash
to run a container with the code mounted and a new SSH session established- Changes in code on the local file system will be directly available in the container (mounted)
- Shutting down the container will not cause any harm to the code, except the vendor packages installed using
vndr
will need to be re-installed after running another container (see step n.2)
- Run (within the container)
vndr