Custom IOptions service

Create a new console application and add packages for DI and Hosting: Add a class for the new object, and an extension method for registering it with dependency injection: Build your hosted service: Build your application entry point, and you can use the options pattern to configure your custom object while registering it: IOptions is […]

Parse all templates in directory in Go

The Go embed package lets you embed files into the compiled application, so you don’t need to publish templates separately. Of course there are advantages and disadvantages to this approach. Here we’re storing the templates in a map, with constants for the keys. The default behavior is to only parse the template on demand when […]