go
What is a .go file?
text/x-go
Go (.go) is a plain-text source file for the Go programming language: a statically typed, compiled language from Google designed for simplicity and concurrency. It features goroutines and channels, a fast compiler, garbage collection, structs with methods, and interfaces, with a strict standard formatting.
How to use a .go file
Use an example .go file to test syntax highlighters, the Go compiler and vet, gofmt, linters, and parser or language-detection tooling.
Download example .go files
- Go: Hello WorldThe classic hello-world in Go (package main, an import, and fmt.Println, tab-indented like gofmt) for testing highlighters, the Go compiler, and parsers.
- Go: Worker pool (goroutines, channels)A realistic Go program: a worker pool with structs and methods, goroutines, buffered channels, and a sync.WaitGroup, tab-indented like gofmt, for testing highlighters, go vet, and parsers.
- Go GenericsGo generics helper for gopls / highlighter fixtures.
- Go: Intentionally InvalidIntentionally invalid Go syntax for gofmt/parser failure tests.
- Go Lint Invalid: Errcheck InvalidIntentionally lint-bait SAMPLE go snippet (errcheck-invalid) for rule-engine tests.