talksapp and lintapp: opt in to use Go 1.8 on GAE standard.
Change-Id: I042f74f8592a8907cde93bcfcd1d6b9e52467b8d
Reviewed-on: https://go-review.googlesource.com/67030
Reviewed-by: Ross Light <light@google.com>
diff --git a/.travis.yml b/.travis.yml
index da8d5de..9163b04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,8 @@
language: go
-install:
- - curl -sSo gae_sdk.zip https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.40.zip
- - unzip -q gae_sdk.zip
+go:
+ - 1.8
script:
- pushd talksapp
- ./setup.sh
- - ../go_appengine/goapp get .
- - ../go_appengine/goapp test -v .
+ - go test -v .
- popd
diff --git a/lintapp/app.yaml b/lintapp/app.yaml
index 878da17..843fa8c 100644
--- a/lintapp/app.yaml
+++ b/lintapp/app.yaml
@@ -1,7 +1,7 @@
application: go-lint
version: 1
runtime: go
-api_version: go1
+api_version: go1.8
handlers:
- url: /favicon\.ico
diff --git a/lintapp/main.go b/lintapp/main.go
index 4bcf7db..f4b686b 100644
--- a/lintapp/main.go
+++ b/lintapp/main.go
@@ -9,6 +9,7 @@
import (
"bytes"
+ "context"
"encoding/gob"
"fmt"
"html/template"
@@ -19,7 +20,6 @@
"strings"
"time"
- "golang.org/x/net/context"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/log"
@@ -182,7 +182,7 @@
}
func runLint(r *http.Request, importPath string) (*lintPackage, error) {
- dir, err := gosrc.Get(httpClient(r), importPath, "")
+ dir, err := gosrc.Get(appengine.NewContext(r), httpClient(r), importPath, "")
if err != nil {
return nil, err
}
diff --git a/talksapp/app.yaml b/talksapp/app.yaml
index 58491b7..193596f 100644
--- a/talksapp/app.yaml
+++ b/talksapp/app.yaml
@@ -1,7 +1,7 @@
application: go-talks
version: 1
runtime: go
-api_version: go1
+api_version: go1.8
handlers:
- url: /robots\.txt
diff --git a/talksapp/main.go b/talksapp/main.go
index c03ddab..5b15445 100644
--- a/talksapp/main.go
+++ b/talksapp/main.go
@@ -9,6 +9,7 @@
import (
"bytes"
+ "context"
"errors"
"fmt"
"html/template"
@@ -26,7 +27,6 @@
"github.com/golang/gddo/gosrc"
"github.com/golang/gddo/httputil"
- "golang.org/x/net/context"
"golang.org/x/tools/present"
)
@@ -193,7 +193,7 @@
}
log.Infof(ctx, "Fetching presentation %s.", importPath)
- pres, err := getPresentation(httpClient(r), importPath)
+ pres, err := getPresentation(ctx, httpClient(r), importPath)
if err != nil {
return err
}
diff --git a/talksapp/main_test.go b/talksapp/main_test.go
index a50c13a..280e705 100644
--- a/talksapp/main_test.go
+++ b/talksapp/main_test.go
@@ -7,6 +7,7 @@
package talksapp
import (
+ "context"
"fmt"
"net/http"
"net/http/httptest"
@@ -53,7 +54,7 @@
`)
originalGetPresentation := getPresentation
- getPresentation = func(client *http.Client, importPath string) (*gosrc.Presentation, error) {
+ getPresentation = func(ctx context.Context, client *http.Client, importPath string) (*gosrc.Presentation, error) {
return &gosrc.Presentation{
Filename: "presentation.slide",
Files: map[string][]byte{
@@ -116,7 +117,7 @@
func TestPresentationNotFound(t *testing.T) {
originalGetPresentation := getPresentation
- getPresentation = func(client *http.Client, importPath string) (*gosrc.Presentation, error) {
+ getPresentation = func(ctx context.Context, client *http.Client, importPath string) (*gosrc.Presentation, error) {
return nil, gosrc.NotFoundError{}
}
defer func() {