GOTYPE(1)
π GOTYPE(1) π
okay bestie, so this is a page from the General Commands Manual and it's all about a lil tool called gotype. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
gotype β syntatic and semantic analysis of Go files
yes, that says "syntatic", not "syntactic" β that's the original spelling, we do not touch it, periodt π
πΈ SYNOPSIS πΈ
gotype [flags] [ path ... ]
π¦ DESCRIPTION π¦
so basically gotype does syntactic and semantic analysis of Go files and packages, like it's the front-end of a Go compiler. it's giving compiler-energy, no cap. π₯
if the analysis fails, it reports errors. if the analysis succeeds? it says absolutely nothing. silent. quiet. a mystery. unless you set -v, then it finally starts talking. π
here's how it picks what to look at:
- no paths at all? it reads from standard input, and that stdin has to provide a single Go source file that defines a complete package. one file. whole package. that's the vibe check.
- one single path and it's a directory? it checks the Go files in that directory, and they must all belong to the same package.
- anything else? then every path has to be the filename of a Go file, and they all have to belong to the same package too.
π OPTIONS π
-aβ use all files (incl._test.go) when processing a directory-astβ print the AST (and yeah, this forces-seq)-commentsβ parse comments (lowkey ignored unless-astor-traceis provided)-eβ report all errors, not just the first 10-seqβ parse sequentially, rather than in parallel-traceβ print parse trace (also forces-seq)-vβ verbose mode π¬
π EXAMPLES π
want to check the files a.go, b.go, and c.go? say less:
gotype a.go b.go c.go
want to check an entire package in the directory dir and print the processed files? main character behaviour:
gotype -v dir
want to check an entire package including tests in the local directory? we love a thorough queen:
gotype -a .
want to verify the output of a pipe? iconic:
echo "package foo" | gotype
π AUTHOR π
this manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). slay π«Ά
that's the whole page bestie, you ate it up π
this was gotype, dated 2013-12-02, from the General Commands Manual β bye bestie, go run it, ilysm π¦β¨π
π¦ where this page comes from
- debian bookworm: golang-golang-x-tools 1:0.5.0+ds-1 Β· BSD-3-Clause
- debian trixie: golang-golang-x-tools 1:0.25.0+ds-1 Β· BSD-3-Clause
- ubuntu jammy: golang-golang-x-tools 1:0.1.9+ds-2ubuntu2 Β· BSD-3-Clause
- ubuntu jammy: golang-golang-x-tools 1:0.1.9+ds-2ubuntu2.2 Β· BSD-3-Clause
- ubuntu noble: golang-golang-x-tools 1:0.18.0+ds-1 Β· BSD-3-Clause
- ubuntu noble: golang-golang-x-tools 1:0.18.0+ds-1ubuntu0.24.04.3 Β· BSD-3-Clause
- ubuntu questing: golang-golang-x-tools 1:0.25.0+ds-1
- ubuntu resolute: golang-golang-x-tools 1:0.42.0+ds-3 Β· BSD-3-Clause
- ubuntu stonking: golang-golang-x-tools 1:0.49.0+ds-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms