github.com/freddyisaac/sicortex-golang@v0.0.0-20231019035217-e03519e66f60/doc/cmd.html (about) 1 <!--{ 2 "Title": "Command Documentation", 3 "Path": "/doc/cmd" 4 }--> 5 6 <p> 7 There is a suite of programs to build and process Go source code. 8 Instead of being run directly, programs in the suite are usually invoked 9 by the <a href="/cmd/go/">go</a> program. 10 </p> 11 12 <p> 13 The most common way to run these programs is as a subcommand of the go program, 14 for instance as <code>go fmt</code>. Run like this, the command operates on 15 complete packages of Go source code, with the go program invoking the 16 underlying binary with arguments appropriate to package-level processing. 17 </p> 18 19 <p> 20 The programs can also be run as stand-alone binaries, with unmodified arguments, 21 using the go <code>tool</code> subcommand, such as <code>go tool vet</code>. 22 This style of invocation allows, for instance, checking a single source file 23 rather than an entire package: <code>go tool vet myprogram.go</code> as 24 compared to <code>go vet mypackage</code>. 25 </p> 26 27 <p> 28 Finally the <code>fmt</code> and <code>godoc</code> commands are installed 29 as regular binaries called <code>gofmt</code> and <code>godoc</code> because 30 they are so often referenced. 31 </p> 32 33 <p> 34 Click on the links for more documentation, invocation methods, and usage details. 35 </p> 36 37 <table class="dir"> 38 <tr> 39 <th>Name</th> 40 <th> </th> 41 <th>Synopsis</th> 42 </tr> 43 44 <tr> 45 <td><a href="/cmd/go/">go</a></td> 46 <td> </td> 47 <td> 48 The <code>go</code> program manages Go source code and runs the other 49 commands listed here. 50 See the command docs for usage 51 details. 52 <br><br> 53 </td> 54 </tr> 55 56 <tr> 57 <td><a href="/cmd/cgo/">cgo</a></td> 58 <td> </td> 59 <td>Cgo enables the creation of Go packages that call C code.</td> 60 </tr> 61 62 <tr> 63 <td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td> 64 <td> </td> 65 <td>Cover is a program for creating and analyzing the coverage profiles 66 generated by <code>"go test -coverprofile"</code>.</td> 67 </tr> 68 69 <tr> 70 <td><a href="/cmd/fix/">fix</a></td> 71 <td> </td> 72 <td>Fix finds Go programs that use old features of the language and libraries 73 and rewrites them to use newer ones.</td> 74 </tr> 75 76 <tr> 77 <td><a href="/cmd/go/">fmt</a></td> 78 <td> </td> 79 <td>Fmt formats Go packages, it is also available as an independent <a href="/cmd/gofmt/"> 80 gofmt</a> command with more general options.</td> 81 </tr> 82 83 <tr> 84 <td><a href="//godoc.org/golang.org/x/tools/cmd/godoc/">godoc</a></td> 85 <td> </td> 86 <td>Godoc extracts and generates documentation for Go packages.</td> 87 </tr> 88 89 <tr> 90 <td><a href="/cmd/vet/">vet</a></td> 91 <td> </td> 92 <td>Vet examines Go source code and reports suspicious constructs, such as Printf 93 calls whose arguments do not align with the format string.</td> 94 </tr> 95 96 </table> 97 98 <p> 99 This is an abridged list. See the <a href="/cmd/">full command reference</a> 100 for documentation of the compilers and more. 101 </p>