When a Go library has a stable API and is useful across multiple projects, I extract it from this repository as a standalone repository.
go get github.com/qdm12/golibs
-
Setup your environment
Using VSCode and Docker (easier)
- Install Docker
- On Windows, share a drive with Docker Desktop and have the project on that partition
- On OSX, share your project directory with Docker Desktop
- With Visual Studio Code, install the remote containers extension
- In Visual Studio Code, press on
F1
and selectRemote-Containers: Open Folder in Container...
- Your dev environment is ready to go!... and it's running in a container 👍 So you can discard it and update it easily!
Locally
-
Install Go dependencies with
go mod download
-
Install golangci-lint
-
You might want to use an editor such as Visual Studio Code with the Go extension. Working settings are already in .vscode/settings.json.
- Install Docker
-
Commands available:
# Lint the code golangci-lint run # Test the code go test ./... # Regenerate mocks for tests go generate -run "mockgen" ./... # Tidy modules dependencies go mod tidy # Run the CI steps with different Docker build targets: docker build --target lint . docker build --target test . docker build --target tidy .
-
See Contributing for more information on how to contribute to this repository.
This repository is under an MIT license