templatectl
templatectl copied to clipboard
Move template package out of internal
This make the package directly usable in other code without calling the command. Also introduce a changable LookupFunc which makes it easier to use templatectl in tests and fake the env without touching the env of the running system.
Hi @gottwald
Thank you for the contribution. The Template function is fairly simple and it's not intended to be imported as a package. Also, we do a simple environment lookup, I'm not sure why we need to mock it. It looks like we don't do anything within this PR either. I think we can close this PR as I don't want to export. the internal package, but let me know if you have anything to add.
The reason we had to import it as a package was in a testing case where we aren't able to modify the env, so we decided to fake it. We could also fork the package, it's not that big of a deal.