tree: 87ad81859ae0fcb7e268cf19448d4c47dfe91170 [path history] [tgz]
  2. Makefile
  6. appinit.go
  7. blog.go
  8. cloudbuild.yaml
  9. codewalk.go
  10. dl.go
  11. doc.go
  12. generate-index.bash
  13. godoc_test.go
  14. goroot.go
  15. handlers.go
  16. hg-git-mapping.bin
  17. index.go
  18. main.go
  19. play.go
  20. regtest_test.go
  21. x.go
  22. x_test.go

Running golangorg

Local Development

For local development, simply build and run. It serves on localhost:6060.

go run .

Local Production Mode

To run in production mode locally, you need:

  • the Google Cloud SDK; see
  • Redis
  • Go sources under $GOROOT
  • Godoc sources inside $GOPATH (go get -d

Build with the golangorg tag and run:

go build -tags golangorg

In production mode it serves on localhost:8080 (not 6060). The port is controlled by $PORT, as in:

PORT=8081 ./golangorg

Local Production Mode using Docker

To run in production mode locally using Docker, build the app's Docker container:

make docker-build

Make sure redis is running on port 6379:

$ echo PING | nc localhost 6379

Run the datastore emulator:

gcloud beta emulators datastore start --project golang-org

In another terminal window, run the container:

$(gcloud beta emulators datastore env-init)

docker run --rm \
	--net host \
	--env GODOC_REDIS_ADDR=localhost:6379 \

It serves on localhost:8080.

Deploying to

Make sure you're signed in to gcloud:

gcloud auth login

Build the image, push it to, and deploy to Flex:

make cloud-build deploy

Point the load balancer to the newly deployed version: (This also runs regression tests)

make publish

Stop and/or delete down any very old versions. (Stopped versions can be re-started.) Keep at least one older verson to roll back to, just in case. You can also migrate traffic to the new version via this UI.


Ensure the Cloud SDK is on your PATH and you have the app-engine-go component installed (gcloud components install app-engine-go) and your components are up-to-date (gcloud components update)