On Fri, Oct 18, 2024 at 9:17 AM 'Axel Wagner' via golang-nuts
wrote:
> I tried it out and the format parsed by debug.ParseBuildInfo is almost
> exactly what is output by go version -m:
> https://go.dev/play/p/L-MNzr0EnjV
> (and yes, my goimports version is old)
And https://go.dev/play/p/bgeGr2h
Damn, I keep forgetting that I had other stuff to say:
My main concern with this approach is that the BuildInfo embedded into
binaries is incomplete in a bunch of circumstances - for example, if you
clone the repository and run `go build` in it (I believe) or if someone
uses a `goimports` version w
On Fri, 18 Oct 2024 at 08:20, Kurtis Rader wrote:
> And, obviously, how do you handle a command named "goimports" installed by
> the user that is not from the golang.org/x/tools repository.
>
I'll note that it should be trivial to check if the BuildInfo.Main.Path is
golang.org/x/tools and BuildI
I tried it out and the format parsed by debug.ParseBuildInfo is almost
exactly what is output by go version -m:
https://go.dev/play/p/L-MNzr0EnjV
(and yes, my goimports version is old)
On Fri, 18 Oct 2024 at 08:20, Kurtis Rader wrote:
> On Thu, Oct 17, 2024 at 10:31 PM shan...@gmail.com
> wrote
On Thu, Oct 17, 2024 at 10:31 PM shan...@gmail.com
wrote:
> I have a need to (programatically) check what version of `goimports`
> someone has installed on their system.
>
It might help if you told us why you need to do that.
The answer by Axel Wagner is somewhat helpful but the output of "go v
Awesome, I think that that will work for us
FTR, I hadn't realised that `gopls` usurped `goimports` - I shall be
updating my ~/.vimrc forthwith :)
On Friday, October 18, 2024 at 3:44:18 PM UTC+10 Axel Wagner wrote:
> You can look at `go version -m /path/to/goimports` to get the version of
> th
You can look at `go version -m /path/to/goimports` to get the version of
the golang.org/x/tools module.
I seem to remember that there was a way to get that information out of a
binary programatically as well, but I can't find it right now. You might
try to look at what the `go version` command does
Hi all,
I have a need to (programatically) check what version of `goimports`
someone has installed on their system.
I cannot, for the life of me, figure out if there's a way to do it other
than
https://groups.google.com/g/golang-nuts/c/in9IVmPc_fQ/m/O4vYNNAZCQAJto
golang-nuts
hey brad, is i