Closed mehdihadeli closed 1 year ago
My problem fixed by changing command to:
goimports-reviser ./... -rm-unused -set-alias -format -recursive
@mehdihadeli it is not a fix. filepath, dir, or just file must be set in the end of the line. in other case, non of your params won’t be applied
@incu6us Hi, I didn't know about that. Below command also works for me
goimports-reviser -local -format -recursive ./...
but when I add -rm-unused
or -set-alias
I get the bellow error:
goimports-reviser -local -format -recursive -rm-unused ./...
Error:
Failed to fix directory: failed to walk dif: failed to fix: package has an errors
@mehdihadeli i'll fix it
Thanks
This happens to me with latest version using this command:
goimports-reviser -format -recursive ./...
response:
2023/08/22 08:41:12 Failed to fix directory: path is not a directory
version:
version: 3.4.1
build with:
tag: v3.4.1
commit: 8ec65d10985bd9e317313a87071246fd985f10b3
source: https://github.com/incu6us/goimports-reviser
closing the issue in case of fix made by @danteay
@incu6us Hi, I still get the error for:
goimports-reviser -rm-unused -set-alias -format -recursive ./...
-: no Go files in
2023/09/15 13:12:39 Failed to fix directory ./...: failed to walk dif: failed to fix: package has an errors
@mehdihadeli one of your package has an error. check your code
But it works fine without error with:
goimports-reviser -format -recursive ./...
When I add -rm-unused
or -set-alias
I will get this error:
-: no Go files in
2023/09/15 13:19:34 Failed to fix directory ./...: failed to walk dif: failed to fix: package has an errors
Need to debug your code. Try to find a file with import which should be removed. Delete the import manually and then check what is wrong. There could be multiple files
For example, I did format in this microservice in my project. I don't know why, could be related to remove some imports with _
or .
through goimports-reviser?
it is known issue https://github.com/incu6us/goimports-reviser/issues/104. working on it
Yes, Maybe problem is here, because other things works
added the feature to v3.5.5
@incu6us Thanks
Hi, At first, thanks for this useful package. When I run this command, I get this error:
Error: