XeroAPI / xerogolang

Golang SDK for the Xero API
MIT License
24 stars 29 forks source link

XERO_PRIVATE_KEY_PATH lazy init #27

Closed febytanzil closed 5 years ago

febytanzil commented 5 years ago

Hi,

In xerogolang.go you hardcoded the private var privateKeyFilePath = os.Getenv("XERO_PRIVATE_KEY_PATH") so before I could run the app, I must set the env first.

Would you consider changing how you initialize the XERO_PRIVATE_KEY_PATH key, so I could init the key during runtime? Just for consistency reason, I compare with the other ENVs that could be initialized during runtime such as XERO_METHOD, key, secret & agent.

Thanks

TheRegan commented 5 years ago

Sure thing, I'm not opposed to that approach. If you flick through a PR with the change made then I'll merge it.

michaeldsp commented 5 years ago

I have created a PR #28 which will resolve this issue, I had the same problem - please review and allow if all in order

TheRegan commented 5 years ago

Sorry for the slow turnaround - I've made a request for some basic changes on that PR but overall am happy with the approach. Thanks for taking the time to do this! :-)

TheRegan commented 5 years ago

Master has been updated to support this thanks to @michaeldsp 🏆