You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Alan Donovan 11b4b5e922 go/analysis/passes/nilness: add longer example to doc 8 hours ago
benchmark/parse benchmark/parse: fix format 1 month ago
blog copyright: test that all files in the repo have copyright notices 3 years ago
cmd cmd/guru: delete it 3 weeks ago
container/intsets all: remove redundant type conversion 2 years ago
copyright x/tools: drop go1.18 support 4 weeks ago
cover cover: eliminate an unnecessary fsync in TestParseProfiles 11 months ago
go go/analysis/passes/nilness: add longer example to doc 5 hours ago
godoc x/tools: drop go1.18 support 4 weeks ago
gopls go/analysis/passes/nilness: add longer example to doc 5 hours ago
imports tools: replace references to obsolete package ioutils 7 months ago
internal inline: make it possible to gob encode/decode inlineMeFacts 2 days ago
playground all: replace all usages of golang.org/x/sys/execabs with os/exec 5 months ago
present x/tools: address review of CL 564515 (CombinedOutput) 1 month ago
refactor refactor/rename: fix renaming of aliases 3 days ago
txtar tools: replace references to obsolete package ioutils 7 months ago
.gitattributes tools: copying .gitattributes to all subrepositories (fixes windows build) 9 years ago
.gitignore .gitignore: roll back ".gitignore: ignore emacs backup files" 6 years ago
.prettierrc all: add a section on JS/CSS formatting to README 4 years ago
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests 6 years ago
LICENSE LICENSE: add 12 years ago
PATENTS go.empty: add PATENTS file to the subrepo. 12 years ago
README.md go/vcs: delete 9 months ago
codereview.cfg tools: add codereview.cfg 9 years ago
go.mod go.mod: update golang.org/x dependencies 3 weeks ago
go.sum go.mod: update golang.org/x dependencies 3 weeks ago

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.