Go Config Tools

Screenshot of a Go structure declaration with tags that allow my configuration loader to load values into it

Both in my professional work and mow my own projects I’ve seen Claude makde huge complicated CONFIG loader routines. Wouldn’t it be great if I could load configuration from the environment just as I unmarshal a JSON structure. The code would be so much easier to read and maintain.

So I’ve done just this at https://github.com/m0rjc/goconfigtools.

I’m adding capabilities to custom validate and, I expect, custom marshal values. This will give very nice compact configuration for my Kubernetes projects both at home and at work.

As an aside – Claude didn’t understand that you could add a varags parameter to a method without breaking existing clients. This explains why goaitools has methods like NewClientWithOptions() rather than just NewClient() with the additional varargs.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *