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/fix: lots of unused code #18568

Closed
shawnps opened this issue Jan 8, 2017 · 4 comments
Closed

cmd/fix: lots of unused code #18568

shawnps opened this issue Jan 8, 2017 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@shawnps
Copy link
Member

shawnps commented Jan 8, 2017

Maybe I'm missing something, but there seems to be a lot of unused code in cmd/fix, many of which I believe left over after this commit:

df93283

➜  fix git:(master) gometalinter --deadline=60s \
             --disable-all --enable=deadcode \
             --exclude=vendor ./...
fix.go:335:1:warning: isPtrPkgDot is unused (deadcode)
fix.go:353:1:warning: isCall is unused (deadcode)
fix.go:359:1:warning: isIdent is unused (deadcode)
fix.go:373:1:warning: isBlank is unused (deadcode)
fix.go:378:1:warning: isEmptyString is unused (deadcode)
fix.go:383:1:warning: warn is unused (deadcode)
fix.go:393:1:warning: countUses is unused (deadcode)
fix.go:408:1:warning: rewriteUses is unused (deadcode)
fix.go:435:1:warning: assignsTo is unused (deadcode)
fix.go:467:1:warning: newPkgDot is unused (deadcode)
fix.go:787:1:warning: renameFix is unused (deadcode)
typecheck.go:136:1:warning: typecheck is unused (deadcode)

They do appear to be unused to me, after checking with git grep:

➜  src git:(master) git grep isPtrPkgDot
cmd/fix/fix.go:// isPtrPkgDot reports whether f is the expression "*pkg.name"
cmd/fix/fix.go:func isPtrPkgDot(t ast.Expr, pkg, name string) bool {
(END)
➜  src git:(master) cd cmd/fix
➜  fix git:(master) git grep "typecheck("
typecheck.go:func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, assign map[string][]interface{}) {
(END)

If they are in fact not necessary anymore, I can go ahead and make a CL removing them.

@josharian
Copy link
Contributor

Go for it. Thanks.

For the future, please use "pkg: bug description" format for issue titles. It helps with triage and tools. I'll fix this one now.

@josharian josharian changed the title Lots of unused code in cmd/fix cmd/fix: lots of unused code Jan 8, 2017
@josharian josharian added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 8, 2017
@josharian josharian added this to the Go1.9Maybe milestone Jan 8, 2017
@shawnps
Copy link
Member Author

shawnps commented Jan 8, 2017

Thanks @josharian. CL is coming soon.

For the future, please use "pkg: bug description" format for issue titles. It helps with triage and tools. I'll fix this one now.

Thanks, will remember that for the future.

@rsc
Copy link
Contributor

rsc commented Jan 8, 2017

Please do NOT delete all that code. That's unused because there are relatively few fixes. It's still useful code. Think of cmd/fix as a library with a bunch of plugins all linked into the same package. The fact that there are few plugins doesn't mean you delete the library.

@shawnps
Copy link
Member Author

shawnps commented Jan 8, 2017

@rsc okay. I'll abandon the CL

@shawnps shawnps closed this as completed Jan 8, 2017
@golang golang locked and limited conversation to collaborators Jan 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants