Repository: go
Issue: tools: track tools/tooling updates to support generics
Labels: NeedsFix,Tools,umbrella

Many tools and libraries that operate on Go code need to be updated to support generics. In most cases, this requires handling of the new constructs introduced in [`go/ast`](#47781) and [`go/types`](#47916).

This is a tracking issue for the status of this support. It is based on #24661, which did the same for modules, though I added several tools/packages, and removed any that have been archived or that don't work directly with Go code.

It is not the case that every tool listed here needs updates to support generics -- many will require no changes. However, any tool that interacts with Go code _might_ need to be updated, and probably needs additional tests.

Issue #50447 tracks adding a transitional API + user guide that should make it easier to get started updating third-party tools.

### How to Help

- Suggest additions to the list below. This list is certainly incomplete. Any tool or library that operates on Go code is a candidate for updating.
- Comment if you're aware of the status of generics support in any of the items below, and I'll update accordingly (or update this comment yourself if you can).
- Try building any of the tools below with Go 1.18, and test them on generic Go code. Comment with your findings.
- Send a PR to update any of the tools below to support generics (this will probably be easier once #50447 is resolved).

### List of tools / packages

- [ ] [apicompat](https://github.com/bradleyfalzon/apicompat)
- [ ] [counterfeiter](https://github.com/maxbrunsfeld/counterfeiter)
- [x] [delve](https://github.com/go-delve/delve)
- [ ] [dupl](https://github.com/mibk/dupl)
- [ ] [errcheck](https://github.com/kisielk/errcheck)
- [ ] [fillstruct](https://github.com/davidrjenni/reftools/tree/master/cmd/fillstruct) - available through `gopls`
- [ ] [goa/goagen](https://github.com/goadesign/goa/tree/master/goagen)
- ~[go-langserver](https://github.com/sourcegraph/go-langserver)~ - use [`gopls`](golang.org/s/gopls) instead
- [ ] [go-critic](https://github.com/go-critic/go-critic)
- [ ] [go-fuzz](https://github.com/dvyukov/go-fuzz) (Note that Go 1.18 has native fuzzing)
- [ ] [go-outline](https://github.com/ramya-rao-a/go-outline) - see golang/vscode-go#1020 for implementing this functionality in gopls
- [ ] go-symbols - TODO: which fork is canonical?
- [ ] [goast-viewer](https://github.com/yuroyoro/goast-viewer)
- ~gocode~ - replaced by `gopls`
- [ ] [goconst](https://github.com/jgautheron/goconst)
- [ ] [gocyclo](https://github.com/fzipp/gocyclo) - [in progress?](https://github.com/fzipp/gocyclo/commit/44804ba326282759f6b21875e1e89840fb3aea25)
- [ ] [godef](https://github.com/rogpeppe/godef)
- [ ] [godoctor](https://github.com/godoctor/godoctor) - available through `gopls`
- [x] go doc
- [x] go fmt - also available through `gopls`
- [x] go vet - #48704; also available through `gopls`
- [x] [gofumpt](https://github.com/mvdan/gofumpt) - also available through `gopls`
- [ ] [golines](https://github.com/segmentio/golines)
- [ ] [gogetdoc](https://github.com/zmb3/gogetdoc)
- [x] [golangci-lint](https://github.com/golangci/golangci-lint) - **Partial generics support -- not all linters are updated** see golangci/golangci-lint#2649
- [ ] [gomodifytags](https://github.com/fatih/gomodifytags) - (see also golang/vscode-go#2002 for merging this functionality with gopls)
- [ ] [gopherjs](https://github.com/gopherjs/gopherjs) - gopherjs/gopherjs#1013
- [ ] [goreturns](https://github.com/sqs/goreturns) - available through `gopls`
- [ ] [go-sumtype](https://github.com/BurntSushi/go-sumtype)
- [ ] [goswagger](https://github.com/go-swagger/go-swagger)
- [ ] [gotags](https://github.com/jstemmer/gotags)
- [ ] [gotests](https://github.com/cweill/gotests) - works, has no special support for generic functions cweill/gotests#165
- [ ] [gotext](https://godoc.org/golang.org/x/text/cmd/gotext)
- [ ] [gqlgen](https://github.com/99designs/gqlgen)
- [ ] [impl](https://github.com/josharian/impl) - see also #37537 for merging this functionality with gopls
- [ ] [ineffassign](https://github.com/gordonklaus/ineffassign)
- [ ] [keyify](https://github.com/dominikh/go-tools/tree/master/cmd/keyify)
- [ ] [lll](https://github.com/walle/lll) - likely no update required
- [ ] [maligned](https://github.com/mdempsky/maligned)
- [ ] [misspell](https://github.com/client9/misspell)
- [ ] [modver](https://github.com/bobg/modver)
- [ ] [moq](https://github.com/matryer/moq)
- [ ] [mockery](https://github.com/vektra/mockery)
- [ ] [motion](https://github.com/fatih/motion)
- [ ] [nakedret](https://github.com/alexkohler/nakedret)
- [x] [pkgsite](https://github.com/golang/pkgsite) - #48264
- [ ] [revive](https://github.com/mgechev/revive)
- [ ] [semgrep](https://github.com/dgryski/semgrep-go)
- [x] [staticcheck](https://staticcheck.io/) - works since version 2022.1; gopls still needs to be updated
- [ ] [unconvert](https://github.com/mdempsky/unconvert)
- [ ] [unparam](https://github.com/mvdan/unparam)
- [ ] x/tools/cmd/bundle
- ~x/tools/cmd/godoc~ - [replaced by pkgsite](https://github.com/golang/go/issues/49212)
- [x] x/tools/cmd/goimports - also available through `gopls`
- [x] x/tools/cmd/gotype - no update required
- [ ] x/tools/cmd/gomvpkg
- [ ] x/tools/cmd/gorename - available through `gopls`
- ~x/tools/cmd/guru~ - replaced by `gopls`
- [x] x/tools/cmd/stringer - https://golang.org/cl/355313
- [x] x/tools/go/analysis - no update required
  - [x] go/analysis/passes/asmdecl
  - [x] go/analysis/passes/assign
  - [x] go/analysis/passes/atomic
  - [ ] go/analysis/passes/atomicalign
  - [x] go/analysis/passes/bools
  - [ ] go/analysis/passes/buildssa
  - [x] go/analysis/passes/buildtag
  - [x] go/analysis/passes/cgocall
  - [x] go/analysis/passes/composite
  - [x] go/analysis/passes/copylock
  - [x] go/analysis/passes/ctrlflow
  - [x] go/analysis/passes/deepequalerrors
  - [x] go/analysis/passes/errorsas
  - [ ] go/analysis/passes/fieldalignment
  - [ ] go/analysis/passes/findcall
  - [x] go/analysis/passes/framepointer
  - [x] go/analysis/passes/httpresponse
  - [x] go/analysis/passes/ifaceassert
  - [x] go/analysis/passes/inspect
  - [x] go/analysis/passes/internal/analysisutil
  - [x] go/analysis/passes/loopclosure
  - [x] go/analysis/passes/lostcancel
  - [x] go/analysis/passes/nilfunc
  - [ ] go/analysis/passes/nilness
  - [ ] go/analysis/passes/pkgfact
  - [x] go/analysis/passes/printf
  - [ ] go/analysis/passes/reflectvaluecompare
  - [ ] go/analysis/passes/shadow
  - [x] go/analysis/passes/shift
  - [x] go/analysis/passes/sigchanyzer
  - [x] go/analysis/passes/sortslice
  - [x] go/analysis/passes/stdmethods
  - [x] go/analysis/passes/stringintconv
  - [x] go/analysis/passes/structtag
  - [ ] go/analysis/passes/testinggoroutine
  - [x] go/analysis/passes/tests
  - [x] go/analysis/passes/unmarshal
  - [x] go/analysis/passes/unreachable
  - [ ] go/analysis/passes/unsafeptr
  - [x] go/analysis/passes/unusedresult
  - [ ] go/analysis/passes/unusedwrite
  - [x] go/analysis/unitchecker
- [x] x/tools/go/analysistest - no update required
- [x] x/tools/go/ast/astutil
- [x] x/tools/go/ast/inspector
- ~x/tools/go/loader~ - Deprecated: replaced by go/packages
- [x] x/tools/go/packages
- [ ] x/tools/go/ssa - #48525
- [x] x/tools/go/types/objectpath
- [x] x/tools/go/types/typeutil
- [ ] x/tools/gopls - works with _default_ options; some analyzers may panic
- [ ] x/tools/refactor/eg
- [ ] x/tools/refactor/rename
- [ ] x/tools/refactor/satisfy