Closed chand1012 closed 4 years ago
I am not seeing the value of this change. This functionality is available through the method that receives a struct and that API is easier to evolve (when new fields are added, will we make a new method each time?).
I appreciate that you took the time to submit a pull request. Thank you for doing that! If you'll forgive me for offering advice mine is to propose a change before submitting a pull request that implements it. That ensures that your effort will be worthwhile and that it will not be duplicated by others.
This change adds a small function to the file located in
reddit/bot.go
that simply allows users to load a bot via any variables they wish, allow for them to load it via any other file type they wish. For my personal use case, since I am running my application in a Docker container, I pass all API keys in via environment variables. This allows me to have the client ID and secret saved on my host and passed in as environment variables. I did not write a test as I do not believe this function warrants one, as the similar function do not have them either. I understand that you could just write the config yourself, but this method allows for a drop in replacement if needed.