Closed jniewt closed 6 days ago
please, more details:
Sorry. There you go:
version: 3.4.5 build with: tag: v3.4.5 commit: 607f2e628d899ae012894fcbd513d85cd65f0281 source: https://github.com/incu6us/goimports-reviser
Command:
/var/lib/snapd/snap/bin/goimports-reviser -rm-unused -company-prefixes foo.com -format -recursive .
Output:
2023/09/14 15:07:07 Failed to fix directory .: failed to walk dif: failed to fix: err: go command required, not found: exec: "go": executable file not found in $PATH: stderr:
I should add I'm trying to move from an older version that doesn't have the version flag, so no idea what version it was, but the command parameters worked there flawlessly. I tried to update with go install but had some problems there so I used snap.
what shows you:
?
$ go version
go version go1.19.12 linux/amd64
$ which go
/usr/bin/go
$ echo $PATH
/home/foo/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/lib/snapd/snap/bin:/home/foo/go/bin:/home/foo/.local/share/JetBrains/Toolbox/scripts
try to use:
PATH=$PATH:/usr/bin /var/lib/snapd/snap/bin/goimports-reviser -rm-unused -format -recursive .
It's still the same error unfortunately.
Your issue is related to configuration of your Snapd. Unfortunately, can't suggest what is wrong on your host with Snap. Reinstall the tool using go command
go install -v github.com/incu6us/goimports-reviser/v3@latest
Any idea why this happens then?
$ go clean -modcache
$ go install -v github.com/incu6us/goimports-reviser/v3@latest
go: downloading github.com/incu6us/goimports-reviser/v3 v3.4.5
go: downloading github.com/incu6us/goimports-reviser v0.1.6
I can't seem to be able to get the right binary out of this, it doesn't even have the -version
option. That's why I tried snap in the first place, because then at least I get the v3 binary.
v1 is fetched because of linter package inside the project. it is ok. try to install the tool using go
and run goimports-reviser with version parameter
my bad. don't use version if you're installing the tool using go
. just use below line to install the latest version
go install -v github.com/incu6us/goimports-reviser/v3@latest
@jniewt have you had a chance to resolve it on you environment?
No, sorry. I gave up and I'm using the old one. Whenever I install it with go like you said it installs fine but when I run it it still seems to run the old one and I can't find the reason for that. Or I assume it's the old one because it doesn't have a -version option.
On Sat, 25 Nov 2023, 21:28 Vyacheslav Pryimak, @.***> wrote:
@jniewt https://github.com/jniewt have you had a chance to resolve it on you environment?
— Reply to this email directly, view it on GitHub https://github.com/incu6us/goimports-reviser/issues/137#issuecomment-1826413834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJJGZKRWTBXJVSKAXRKR6VTYGJIF7AVCNFSM6AAAAAA4YALO3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGQYTGOBTGQ . You are receiving this because you were mentioned.Message ID: @.***>
I installed goimports-reviser with go (go install -v github.com/incu6us/goimports-reviser/v3@latest
) . but I got the same error when i configure it in goland.
@elbert-chan is it working from cli? not via your IDE?
@elbert-chan is it working from cli? not via your IDE?
yes, cli is working. but IDE(goland) is not.
I removed all files concerning goimports-reviser from my system and installed it with: go install -v github.com/incu6us/goimports-reviser/v3@latest
(from the terminal window within Goland IDE). The resulting binary still doesn't have the -version
flag, but it doesn't complain anymore about go.mod containing toolchain
keyword, so I don't know what to make of it. It seems I have the new version now...?
I removed all files concerning goimports-reviser from my system and installed it with:
go install -v github.com/incu6us/goimports-reviser/v3@latest
(from the terminal window within Goland IDE). The resulting binary still doesn't have the-version
flag, but it doesn't complain anymore about go.mod containingtoolchain
keyword, so I don't know what to make of it. It seems I have the new version now...?
yes. it is the latest version
@jniewt Have you solved your problem? I'm having the same issue.
just solved my problem, need to add go/libexec to $PATH
@jniewt Have you solved your problem? I'm having the same issue.
Installed with snap and now I'm getting:
Failed to fix file: err: go command required, not found: exec: "go": executable file not found in $PATH: stderr:
even though go (1.19) is in my $PATH.