Skip to content

Commit

Permalink
[x/tour] tour: make the tour deployable on App Engine again
Browse files Browse the repository at this point in the history
Move the main Go files into the same directory as the app.yaml file.
This changes the command location to be at golang.org/x/tour instead
of golang.org/x/tour/gotour. Add a placeholder command in gotour so
that those who use the previous installation command will know to
use the new one and it won't just seem like it has vanished.

Also update the documentation to take into account that the tour is
no longer distributed with releases as of golang.org/cl/131156

Fixes golang/go#28163

Change-Id: I60737f0cfaa93d12902a75fbc0924d96672a8c9b
Reviewed-on: https://go-review.googlesource.com/c/141857
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
X-Tour-Commit: 5807c4fa28aba30e78d2ef679bb99cd9fe45c9b9
  • Loading branch information
andybons committed Oct 19, 2018
1 parent f529548 commit 501422f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 39 deletions.
11 changes: 3 additions & 8 deletions tour/README.md
@@ -1,16 +1,11 @@
A Tour of Go is an introduction to the Go programming language.

The easiest way to install the tour locally is to install
[a binary release of Go](https://golang.org/dl/) and then run:

$ go tool tour

To install the tour from source, first
To install the tour from source, first
[set up a workspace](https://golang.org/doc/code.html) and then run:

$ go get golang.org/x/tour/gotour
$ go get golang.org/x/tour

This will place a `gotour` binary in your workspace's `bin` directory.
This will place a `tour` binary in your workspace's `bin` directory.

Unless otherwise noted, the go-tour source files are distributed
under the BSD-style license found in the LICENSE file.
Expand Down
5 changes: 2 additions & 3 deletions tour/app.yaml
@@ -1,13 +1,12 @@
application: go-tour
version: 1
service: tour
runtime: go
api_version: go1

default_expiration: "7d"

handlers:

# Keep these static file handlers in sync with gotour/local.go.
# Keep these static file handlers in sync with local.go.
- url: /favicon.ico
static_files: static/img/favicon.ico
upload: static/img/favicon.ico
Expand Down
File renamed without changes.
45 changes: 19 additions & 26 deletions tour/content/welcome.article
Expand Up @@ -70,48 +70,41 @@ The tour is available in other languages:
Click the [[javascript:highlightAndClick(".next-page")]["next"]] button or type `PageDown` to continue.

#appengine: * Go offline
#appengine:
#appengine:
#appengine: This tour is also available as a stand-alone program that you can use
#appengine: without access to the internet.
#appengine:
#appengine:
#appengine: The stand-alone tour is faster, as it builds and runs the code samples
#appengine: on your own machine.
#appengine:
#appengine: To run the tour locally first
#appengine: [[https://golang.org/dl/][download and install Go]]
#appengine: then start the tour from the command line:
#appengine:
#appengine: go tool tour
#appengine:
#appengine: Or, you can install and run this tour manually if you have any trouble
#appengine: running the above command:
#appengine:
#appengine: go get golang.org/x/tour/gotour
#appengine: gotour
#appengine:
#appengine:
#appengine: To run the tour locally install and run the tour binary:
#appengine:
#appengine: go get golang.org/x/tour
#appengine: tour
#appengine:
#appengine: The tour program will open a web browser displaying
#appengine: your local version of the tour.
#appengine:
#appengine:
#appengine: Or, of course, you can continue to take the tour through this web site.

#appengine: * The Go Playground
#appengine:
#appengine:
#appengine: This tour is built atop the [[https://play.golang.org/][Go Playground]], a
#appengine: web service that runs on [[https://golang.org/][golang.org]]'s servers.
#appengine:
#appengine:
#appengine: The service receives a Go program, compiles, links, and runs the program inside
#appengine: a sandbox, then returns the output.
#appengine:
#appengine: There are limitations to the programs that can be run in the playground:
#appengine:
#appengine:
#appengine: There are limitations to the programs that can be run in the playground:
#appengine:
#appengine: - In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.
#appengine:
#appengine: - There are also limits on execution time and on CPU and memory usage, and the program cannot access external network hosts.
#appengine:
#appengine:
#appengine: - There are also limits on execution time and on CPU and memory usage, and the program cannot access external network hosts.
#appengine:
#appengine: The playground uses the latest stable release of Go.
#appengine:
#appengine:
#appengine: Read "[[https://blog.golang.org/playground][Inside the Go Playground]]" to learn more.
#appengine:
#appengine:
#appengine: .play welcome/sandbox.go

* Congratulations
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions tour/gotour/main.go
@@ -0,0 +1,15 @@
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"io"
"os"
)

func main() {
io.WriteString(os.Stderr, "golang.org/x/tour/gotour has moved to golang.org/x/tour\n")
os.Exit(1)
}
2 changes: 1 addition & 1 deletion tour/gotour/local.go → tour/local.go
Expand Up @@ -106,7 +106,7 @@ func main() {
origin := &url.URL{Scheme: "http", Host: host + ":" + port}
http.Handle(socketPath, socket.NewHandler(origin))

// Keep these static file handlers in sync with ../app.yaml.
// Keep these static file handlers in sync with app.yaml.
static := http.FileServer(http.Dir(root))
http.Handle("/content/img/", static)
http.Handle("/static/", static)
Expand Down
2 changes: 1 addition & 1 deletion tour/gotour/tour.go → tour/tour.go
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main // import "golang.org/x/tour/gotour"
package main // import "golang.org/x/tour"

import (
"bytes"
Expand Down

0 comments on commit 501422f

Please sign in to comment.