Closed kevincobain2000 closed 11 months ago
Hello!
An interesting idea, but I don’t really understand what its essence is yet. Are we trying to provide some logic to the user? We don't have too many teams to get confused about.
According to the given options. The first option is clear, but what if I want to install the latest version of go in the project directory with go.mod?
The second case is not clear to me. If we are outside the directory with the go.mod file, how are we supposed to know to use a certain configuration? If I understand everything correctly, then for the second case the third given option will be used.
There are still too many questions about the logic of work.
Ah sorry. In Case 2, go.mod version will also be none. I have edited.
The purpose of this is that a user will be able to achieve what he wants to achieve just by executing gobrew
with no args.
I think it looks good.
Thanks for checking @juev I ll work on it.
+1
This will be useful in CI too I think
Thanks @gedw99
Was thinking a —output=json would be nice too. Then it’s easy to use in CI and possibly other use cases that are not known yet.
than it possible to parse the json on the call side and react to the output.
maybe layer a golang client that understands the json in a strongly type way too.
basically I realise it’s jsonrpc style with client and server .
there are some great golang libs that do all the grunt work for json rpc out there in GitHub btw.
Thanks @gedw99
JSON output could be nice, and I also find hard time finding it's use case.
Only use case I can think of is for the infra/dev-ops/SRE-admin teams, who develop their admin portals inside their companies to just list up some GO versions in a dropdown.
Other than that, I don't know, if JSON output is really necessary and people want to use it on CI with jq
RFC
To add interactive behaviour so I don't have to remember commands like
gobrew use mod
gobrew use latest
or evengobrew ls
andgobrew ls-remote
to check what version I am on etc and etc.Current situation
On command
gobrew
, no args, it displays help menu right now.Proposal
On hitting
gobrew
, it presents an interactive info as below:Case 1: Fresh install, from inside a directory with go.mod
Case 2: Fresh install, from outside a directory with go.mod
Case 3: Go is installed, but not latest version
Case 4: Go is installed, but not latest version, but matches mod file
Case 5: Go is installed, on latest version, but doesn't match mod file
-- 1) Above can be obtained on hitting
gobrew
. 1.1) Additionally, could add--no-interactive y|n
option as well. But I don't think that would be necessary at this point. 2) Or if intractive is too much, then we could consider atleastgobrew info
that will only display out info.