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

cmd/go: go clean removes source code #5665

Closed
dustin opened this issue Jun 7, 2013 · 7 comments
Closed

cmd/go: go clean removes source code #5665

dustin opened this issue Jun 7, 2013 · 7 comments
Milestone

Comments

@dustin
Copy link

dustin commented Jun 7, 2013

go clean blindly removes files with the same name of the directory.  At some point in
the past I began naming my github repos something.go, often containing a source file
called something.go, which clean blindly removes.

Ideally, the clean tool would know that the package isn't main so the build tool
wouldn't produce a file called DIR.

This isn't particularly difficult to work around, but the behavior is unexpected and has
caused confusion a few times when cleaning up caused my compiles to fail by deleting
dependency source code.
@dustin
Copy link
Author

dustin commented Jun 7, 2013

Comment 1:

A few of examples where this affected me (before I changed my naming scheme):
github.com/dustin/nma.go
github.com/dustin/yammer.go
github.com/dustin/rs232.go

@AlekSi
Copy link
Contributor

AlekSi commented Jun 7, 2013

Comment 2:

It also breaks go get:
$ go get github.com/dustin/nma.go
stat github.com/dustin/nma.go: no such file or directory

@robpike
Copy link
Contributor

robpike commented Jun 8, 2013

Comment 3:

Labels changed: added priority-soon, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jun 10, 2013

Comment 4:

I agree that go clean should not remove the directory name unless the source files say
package main.
I don't want to pepper the code with checks for .go suffixes.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 5:

Labels changed: added go1.2.

@adg
Copy link
Contributor

adg commented Aug 19, 2013

Comment 6:

https://golang.org/cl/12807044

Status changed to Started.

@adg
Copy link
Contributor

adg commented Aug 19, 2013

Comment 7:

This issue was closed by revision 2f6e9a1.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants