I also think that printf debugging is fine, but there are better tools [1] - however they might be more involved to setup, or not be available in your codebase.
Go: go templates and fiber for http serving. I have a mini framework for adding some structure to the templates (folder per feature: contains controller, templates, etc, and some naming conventions)
If I understood correctly, you can achive this with `hx-target` and `hx-select` - I'm doing this in an app to replace an editor content based on which link is clicked.
[1]: https://andydote.co.uk/2024/11/24/print-debugging-tracing/