aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-03-15 16:24:46 -0400
committerRuss Cox <rsc@golang.org>2022-03-15 21:20:57 +0000
commit7a60f303d8c4f3c0c7daab7b2175a6ff4f692698 (patch)
tree43d79ef8ecca9a5ba29c6cff56caf04ef4d2f3bf /cmd
parentf22c23a0f3fe0beae558022ebe020fc114cec285 (diff)
downloadgo-x-website-7a60f303d8c4f3c0c7daab7b2175a6ff4f692698.tar.xz
all: handle Go 1.18 code on Go 1.16 AppEngine using new internal/backport/go/*
The immediate need was go/build, because the Go 1.16 go/build rejects code that has //go:build without // +build, as Go 1.18 code now does. But displaying code using generics would also have failed, for inability to parse that code. Add the full go/ast, go/doc, go/format, go/parser, go/printer, go/scanner, and go/token to fix those failures, which would become more frequent as generics are used more inside the standard library. The code is all from the go1.18 tag of the Go repo, post-processed to rewrite imports and apply gofmt -w -r 'any -> interface{}' to keep it building with the other backports and with Go 1.16 syntax. For golang/go#51686. Change-Id: I1e14f4634d8bc09bdaa04c014eadb1be97ea5047 Reviewed-on: https://go-review.googlesource.com/c/website/+/393194 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/golangorg/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go
index 41d2c6bd..88c8d32a 100644
--- a/cmd/golangorg/server.go
+++ b/cmd/golangorg/server.go
@@ -14,7 +14,6 @@ import (
"errors"
"flag"
"fmt"
- "go/format"
"io/fs"
"io/ioutil"
"log"
@@ -32,6 +31,7 @@ import (
"cloud.google.com/go/datastore"
"golang.org/x/build/repos"
"golang.org/x/website"
+ "golang.org/x/website/internal/backport/go/format"
"golang.org/x/website/internal/backport/html/template"
"golang.org/x/website/internal/blog"
"golang.org/x/website/internal/codewalk"