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:
Родитель
44b8c1d75c
Коммит
5807c4fa28
11
README.md
11
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.
|
||||
|
|
5
app.yaml
5
app.yaml
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
Загрузка…
Ссылка в новой задаче