Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go clean can delete code #3494

Open
Sc00bz opened this issue Aug 17, 2024 · 2 comments
Open

go clean can delete code #3494

Sc00bz opened this issue Aug 17, 2024 · 2 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Sc00bz
Copy link

Sc00bz commented Aug 17, 2024

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.22.0 windows/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.16.1
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.92.2
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.42.0

Describe the bug

If you name your folder blah.go and have you code in a file called blah.go, then run go clean it will delete blah.go/blah.go.

Steps to reproduce the behavior:

  1. Create folder called blah.go
  2. Create file called blah.go/blah.go with contents "package main"
  3. Create file called blah.go/go.mod with contents "module blah
    go 1.22"
  4. Run go clean
  5. File blah.go/blah.go is gone.

Fix

go clean should check if folder name ends in .go before deleting a file named the same as the parent folder.

@gopherbot gopherbot added this to the Untriaged milestone Aug 17, 2024
@hyangah
Copy link
Contributor

hyangah commented Aug 19, 2024

By go clean, do you mean the Go command's clean subcommand, or something else?
(In other words, the step 4 means, run go clean from the terminal?)

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 19, 2024
@Sc00bz
Copy link
Author

Sc00bz commented Aug 19, 2024

In other words, the step 4 means, run go clean from the terminal?

Yes, and while being in the folder blah.go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants