1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:06:09 -07:00

cmd/godoc: remove workaround for 1.8 behavior

1.8 is no longer supported. Remove code that placates it.
Also removes a superfluous newline in appinit.go.

Change-Id: I9c89b5bddf4c001d0854404114fb354209ad6024
Reviewed-on: https://go-review.googlesource.com/131715
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Bonventre 2018-08-27 15:23:45 -06:00 committed by Brad Fitzpatrick
parent 4426aff4d0
commit 6cd1fcedba
3 changed files with 1 additions and 27 deletions

View File

@ -24,7 +24,6 @@ import (
"golang.org/x/tools/godoc/vfs" "golang.org/x/tools/godoc/vfs"
"golang.org/x/tools/godoc/vfs/mapfs" "golang.org/x/tools/godoc/vfs/mapfs"
"golang.org/x/tools/godoc/vfs/zipfs" "golang.org/x/tools/godoc/vfs/zipfs"
"google.golang.org/appengine" "google.golang.org/appengine"
) )

View File

@ -1,9 +0,0 @@
// Copyright 2017 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.
// +build go1.9
package main_test
func init() { isGo19 = true }

View File

@ -54,21 +54,11 @@ func buildGodoc(t *testing.T) (bin string, cleanup func()) {
return bin, func() { os.RemoveAll(tmp) } return bin, func() { os.RemoveAll(tmp) }
} }
var isGo19 bool // godoc19_test.go sets it to true.
// Basic regression test for godoc command-line tool. // Basic regression test for godoc command-line tool.
func TestCLI(t *testing.T) { func TestCLI(t *testing.T) {
bin, cleanup := buildGodoc(t) bin, cleanup := buildGodoc(t)
defer cleanup() defer cleanup()
// condStr returns s if cond is true, otherwise empty string.
condStr := func(cond bool, s string) string {
if !cond {
return ""
}
return s
}
tests := []struct { tests := []struct {
args []string args []string
matches []string // regular expressions matches []string // regular expressions
@ -91,13 +81,7 @@ func TestCLI(t *testing.T) {
{ {
args: []string{"nonexistingpkg"}, args: []string{"nonexistingpkg"},
matches: []string{ matches: []string{
`cannot find package` + `cannot find package`,
// TODO: Remove this when support for Go 1.8 is dropped.
condStr(!isGo19,
// For Go 1.8 and older, because it doesn't have CL 33158 change applied to go/build.
// The last pattern (does not e) is for plan9:
// http://build.golang.org/log/2d8e5e14ed365bfa434b37ec0338cd9e6f8dd9bf
`|no such file or directory|does not exist|cannot find the file|(?:' does not e)`),
}, },
}, },
{ {