all: merge master (f112c43) into gopls-release-branch.0.10

Also update the go.mod to put back the replace directive.

Conflicts:

- gopls/go.mod
- gopls/go.sum

Merge List:

+ 2022-10-20 f112c4332 go.mod: update golang.org/x dependencies
+ 2022-10-20 207f456f2 go/internal/gcimporter: bump version number in skew check
+ 2022-10-20 65196caee gopls/README.md: fix wording around supported Go versions
+ 2022-10-20 61280309a gopls/internal: support renaming packages with int. test variants
+ 2022-10-20 649df2ea1 go.mod: mark as requiring -compat 1.16
+ 2022-10-19 91311ab3b gopls/internal/lsp/cache: better import path hygiene
+ 2022-10-19 9eda97bc2 go/analysis: enable a test that applies after go list behavior change
+ 2022-10-19 b50d7ba6e gopls: minor cleanup of standalone package support
+ 2022-10-19 502b93c33 gopls/internal/lsp: tolerate missing end position in RelatedInformation
+ 2022-10-19 d67c3ada0 internal/imports: repair warnings from default analyzers
+ 2022-10-18 bc2e3aeab internal/jsonrpc2_v2: add Func convenience wrappers for the Binder and Preempter interfaces
+ 2022-10-18 a9b653b41 cmd/compilebench: use -a instead of -i to ensure dependencies are built
+ 2022-10-18 4818d9eec Revert "gopls/internal/lsp/cache: disable strict analysis while we fix panics"
+ 2022-10-17 b2efd4d15 internal/jsonrpc2_v2: eliminate most arbitrary timeouts in tests
+ 2022-10-17 371ef162f internal/jsonrpc2_v2: rework concurrency in idleListener
+ 2022-10-17 593553125 internal/jsonrpc2_v2: remove “Box” suffix from channel field names
+ 2022-10-17 fd32990e0 internal/jsonrpc2_v2: error out in-flight client calls when the reader breaks
+ 2022-10-17 0e222f5c6 internal/jsonrpc2_v2: close the underlying connection if Wait is called instead of Close
+ 2022-10-17 bc4e384f8 gopls/internal/lsp/cache: fix crash in analysis
+ 2022-10-17 b93a56f28 refactor/satisfy: fix visiting functions in the unsafe package
+ 2022-10-15 9b5e55b1a gopls/internal/lsp/cache: disable strict analysis while we fix panics
+ 2022-10-13 9ffaf69c2 gopls/internal/lsp/cache: minor analysis cleanups

Change-Id: I2337730a702e26b41fa6167c4aea4f8dc4b9a48f
tree: 161d68a02bba501ccc772e547b6eb512c28f1929
  1. benchmark/
  2. blog/
  3. cmd/
  4. container/
  5. copyright/
  6. cover/
  7. go/
  8. godoc/
  9. gopls/
  10. imports/
  11. internal/
  12. playground/
  13. present/
  14. refactor/
  15. txtar/
  16. .gitattributes
  17. .gitignore
  18. .prettierrc
  19. codereview.cfg
  20. CONTRIBUTING.md
  21. go.mod
  22. go.sum
  23. LICENSE
  24. PATENTS
  25. README.md
README.md

Go Tools

PkgGoDev

This repository provides the golang.org/x/tools module, comprising various tools and packages mostly for static analysis of Go programs, some of which are listed below. Use the “Go reference” link above for more information about any package.

It also contains the golang.org/x/tools/gopls module, whose root package is a language-server protocol (LSP) server for Go. An LSP server analyses the source code of a project and responds to requests from a wide range of editors such as VSCode and Vim, allowing them to support IDE-like functionality.

Selected commands:

  • cmd/goimports formats a Go program like go fmt and additionally inserts import statements for any packages required by the file after it is edited.
  • cmd/callgraph prints the call graph of a Go program.
  • cmd/digraph is a utility for manipulating directed graphs in textual notation.
  • cmd/stringer generates declarations (including a String method) for “enum” types.
  • cmd/toolstash is a utility to simplify working with multiple versions of the Go toolchain.

These commands may be fetched with a command such as

go install golang.org/x/tools/cmd/goimports@latest

Selected packages:

  • go/ssa provides a static single-assignment form (SSA) intermediate representation (IR) for Go programs, similar to a typical compiler, for use by analysis tools.

  • go/packages provides a simple interface for loading, parsing, and type checking a complete Go program from source code.

  • go/analysis provides a framework for modular static analysis of Go programs.

  • go/callgraph provides call graphs of Go programs using a variety of algorithms with different trade-offs.

  • go/ast/inspector provides an optimized means of traversing a Go parse tree for use in analysis tools.

  • go/cfg provides a simple control-flow graph (CFG) for a Go function.

  • go/expect reads Go source files used as test inputs and interprets special comments within them as queries or assertions for testing.

  • go/gcexportdata and go/gccgoexportdata read and write the binary files containing type information used by the standard and gccgo compilers.

  • go/types/objectpath provides a stable naming scheme for named entities (“objects”) in the go/types API.

Numerous other packages provide more esoteric functionality.

Contributing

This repository uses Gerrit for code changes. To learn how to submit changes, see https://golang.org/doc/contribute.html.

The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.

JavaScript and CSS Formatting

This repository uses prettier to format JS and CSS files.

The version of prettier used is 1.18.2.

It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.