Cobra refactor with tests#6
Conversation
…ated GetToken function name
artur-sak13
left a comment
There was a problem hiding this comment.
There are a few areas that can be improved (mostly Go "gotchas") but overall I really like where this is going. This is really impressive work especially considering that it's one of the first things you've ever written in Go. Excellent job!
By the way, are you planning on keeping the libraries under your "fantasticrabbit" namespace or do you plan on moving it under @twopt's?
| @@ -0,0 +1,48 @@ | |||
| package cmd | |||
There was a problem hiding this comment.
Honestly, I don't think you need to include a set command at this point. The config file won't be modified frequently (and probably shouldn't) and you can always override with inline environment variables (e.g. $ CLICKUP_TEAM_ID=example CLICKUP_TOKEN=pk_xxxxx clickup get task 9hz).
There was a problem hiding this comment.
I feel like it's a better way of generally providing Team ID. In certain use cases Team ID may not always be the same (think members of different teams using separate Clickup Spaces, but accessing from the same environment) so a machine environment variable may not work.
There was a problem hiding this comment.
I'm not suggesting a machine environment variable but a user-provided one. I have to do this all the time when using the aws-cli (or any related tooling), to get information from/deploy to our various AWS accounts. Each team member should have their own config and credentials even if they are on the same environment. One person swapping/overriding their Team ID shouldn't affect anyone else.
…tch to filepath.join
Replacing the initial cobra refactor PR that was accidentally merged.
Refactor to implement cobra/viper and abstracted http requests for setting up tests.