OSDN Git Service

Update Go library to last weekly.
[pf3gnuchains/gcc-fork.git] / libgo / go / exp / gotype / doc.go
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 /*
6 The gotype command does syntactic and semantic analysis of Go files
7 and packages similar to the analysis performed by the front-end of
8 a Go compiler. Errors are reported if the analysis fails; otherwise
9 gotype is quiet (unless -v is set).
10
11 Without a list of paths, gotype processes the standard input, which must
12 be the source of a single package file.
13
14 Given a list of file names, each file must be a source file belonging to
15 the same package unless the package name is explicitly specified with the
16 -p flag.
17
18 Given a directory name, gotype collects all .go files in the directory
19 and processes them as if they were provided as an explicit list of file
20 names. Each directory is processed independently. Files starting with .
21 or not ending in .go are ignored.
22
23 Usage:
24         gotype [flags] [path ...]
25
26 The flags are:
27         -e
28                 Print all (including spurious) errors.
29         -p pkgName
30                 Process only those files in package pkgName.
31         -r
32                 Recursively process subdirectories.
33         -v
34                 Verbose mode.
35
36 Debugging flags:
37         -ast
38                 Print AST (disables concurrent parsing).
39         -trace
40                 Print parse trace (disables concurrent parsing).
41
42
43 Examples
44
45 To check the files file.go, old.saved, and .ignored:
46
47         gotype file.go old.saved .ignored
48
49 To check all .go files belonging to package main in the current directory
50 and recursively in all subdirectories:
51
52         gotype -p main -r .
53
54 To verify the output of a pipe:
55
56         echo "package foo" | gotype
57
58 */
59 package documentation
60
61 // BUG(gri): At the moment, only single-file scope analysis is performed.