Skip to content

bootstrap capability

bootstrap adds the Composition Root pattern to your Go service, keeping main.go thin and all dependency wiring in a dedicated, testable module.

  • Thin main.go that calls bootstrap.Run(version)
  • internal/bootstrap/bootstrap.go with all dependency wiring
  • Partial injection points

Use bootstrap alongside platform in any service where you want testable dependency injection. The Composition Root pattern keeps wiring logic out of main.go and in a package that tests can import and override.

Requires: platform

Terminal window
verikt new my-service --language go --cap platform,bootstrap
# or add to an existing service:
verikt add bootstrap

platform

Required platform capability for lifecycle and config.

testing

Test utilities that pair with the bootstrap wiring pattern.

observability

Wire observability providers in the bootstrap module.