content/static/doc/tutorial: don't "go run" individual files

Go packages are implicitly made of all the files in a directory,
filtered by build tags. This is a core mechanic of using Go and of
contributing to Go projects. It's also different from many other
languages, including C and Rust, where code in different compilation
units can coexist in the same directory.

The only exception is when Go files are specified on the command line,
in which case a synthetic command-line-arguments package is composed
from them, ignoring build tags.

I don't think it helps beginners to expose them to this exception which
they would otherwise probably never make any use of.

This CL was motivated by hearing of a beginner being confused trying to
contribute to an existing project, because they were trying to "go run"
an individual file, which was failing with a wall of error because of
all the missing symbols from the other files in the package.

Change-Id: Iec0ef73df1c5ada2299d059dd468dc2095c367a8
Trust: Filippo Valsorda <>
Reviewed-by: Steve Traut <>
2 files changed
tree: 9617e26ebcede97c68d05e7c4b57a3607e88cb06
  1. .prettierrc
  8. cmd/
  9. codereview.cfg
  10. content/
  11. favicon.ico
  12. go.mod
  13. go.sum
  14. internal/
  15. robots.txt

Go website

Go Reference

This repository holds the Go website server code and content.

Checkout and Run

To download and run the web server locally:

  • git clone
  • cd website
  • go run ./cmd/golangorg
  • Open http://localhost:6060/ in your browser.

See cmd/golangorg/ for more details.

Changing Content

To make basic changes to the website content:

  • Make the changes you want in the content/static directory.
  • Stop any running go run ./cmd/golangorg.
  • go generate ./content/static
  • go run ./cmd/golangorg
  • Open http://localhost:6060/ in your browser.

See content/ for more sophisticated instructions.

JS/CSS Formatting

This repository uses prettier to format JS and CSS files.

The version of prettier used is 1.18.2.

It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see

The main issue tracker for the website repository is located at Prefix your issue with “x/website:” in the subject line, so it is easy to find.