tour: make the tour deployable on App Engine again

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>
This commit is contained in:
Andrew Bonventre 2018-10-12 11:18:43 -04:00
Родитель 44b8c1d75c
Коммит 5807c4fa28
8 изменённых файлов: 41 добавлений и 39 удалений

Просмотреть файл

@ -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
[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.

Просмотреть файл

@ -1,5 +1,4 @@
application: go-tour
version: 1
service: tour
runtime: go
api_version: go1
@ -7,7 +6,7 @@ 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

Просмотреть файл

Просмотреть файл

@ -77,17 +77,10 @@ Click the [[javascript:highlightAndClick(".next-page")]["next"]] button or type
#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: To run the tour locally install and run the tour binary:
#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: 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.

Просмотреть файл

15
gotour/main.go Normal file
Просмотреть файл

@ -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)
}

Просмотреть файл

@ -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)

Просмотреть файл

@ -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"