command module
v0.0.0-...-fc0b594 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0



A version of gotype that allows for processing of code as it is being edited.


gotype-live has been archived as it does not support go modules, and has been replaced by gopls.



The gotype command does syntactic and semantic analysis of Go files and packages like the front-end of a Go compiler. Errors are reported if the analysis fails; otherwise gotype is quiet (unless -v is set).

Without a list of paths, gotype reads from standard input, which must provide a single Go source file defining a complete package.

If a single path is specified that is a directory, gotype checks the Go files in that directory; they must all belong to the same package.

Otherwise, each path must be the filename of Go file belonging to the same package.


gotype [flags] [path...]

The flags are:

	use all (incl. _test.go) files when processing a directory
	report all errors (not just the first 10)
	verbose mode
	use the contents of stdin in place of the named file on disk
	lookup mode. defaults to "go". options are "go" and "gb"
	use gccimporter instead of gcimporter

Debugging flags:

	parse sequentially, rather than in parallel
	print AST (forces -seq)
	print parse trace (forces -seq)
	parse comments (ignored unless -ast or -trace is provided)


To check the files a.go, b.go, and c.go:

gotype a.go b.go c.go

To check an entire package in the directory dir and print the processed files:

gotype -v dir

To check an entire package including tests in the local directory:

gotype -a .

To verify the output of a pipe:

echo "package foo" | gotype

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL