Well, I made some code in my work experiences where I used Go Webservices that I instrumented with OpenTelemetry. In this project, I make an attempt to restart the design from scratch of an OpenTelemetry monitored web-based service to propose a nice architecture to be used as a base for a later application development.
This projects makes an attempt to match the Standard Go Project Layout. It also replicates some code structures that I found rather elegant (for Go code ...) in other Open-Source Go projects:
- Uber Go Style Guide and Golang Practical Tips provide guidance to write clear and effective Go code.
- Functional Options frome Dave Cheney extensively used in open-telemetry/opentelemetry-go where I first discovered it.
- In Handling errors in Go web apps, the author proposes a clean approach to decouple the error handling from the logic of the http handlers without any additional library.
- Packages heavily tighted to a technology like
tools/users/postgres
(which implements user store on a Postgres database) are tested with testcontainers.
- Standard Go Project Layout
- Uber Go Style Guide
- Golang Practical Tips
- Functional Options
- boldlygo.tech post on handling errors in Go web apps
- LogRocket article: Rate limiting your Go application
- An article on TestContainer in Go by a former colleague
- Article on implementing a password authentication in a Go application