From d2e00652bac3dae765da6608ff9b84b445e25aa6 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 21 Jan 2016 13:59:03 -0800 Subject: [PATCH] x/tools: fix build Change-Id: I02b42abcc29ee04c8f54dc8ba2c6079b3e6c4153 Reviewed-on: https://go-review.googlesource.com/18816 Run-TryBot: Robert Griesemer Reviewed-by: Alan Donovan --- go/buildutil/go16_test.go | 14 -------------- go/buildutil/util_test.go | 9 --------- refactor/importgraph/go16_test.go | 12 ------------ refactor/importgraph/graph_test.go | 12 ------------ 4 files changed, 47 deletions(-) delete mode 100644 go/buildutil/go16_test.go delete mode 100644 refactor/importgraph/go16_test.go diff --git a/go/buildutil/go16_test.go b/go/buildutil/go16_test.go deleted file mode 100644 index 7bb889ed..00000000 --- a/go/buildutil/go16_test.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 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. - -// Incomplete source tree on Android. - -// +build !android -// +build go1.6 - -package buildutil_test - -func init() { - go16 = true -} diff --git a/go/buildutil/util_test.go b/go/buildutil/util_test.go index 295e2918..dd55533c 100644 --- a/go/buildutil/util_test.go +++ b/go/buildutil/util_test.go @@ -18,8 +18,6 @@ import ( "golang.org/x/tools/go/buildutil" ) -var go16 bool // Go version >= go1.6 - func TestContainingPackage(t *testing.T) { // unvirtualized: goroot := runtime.GOROOT() @@ -32,13 +30,6 @@ func TestContainingPackage(t *testing.T) { {gopath + "/src/golang.org/x/tools/go/buildutil/util_test.go", "golang.org/x/tools/go/buildutil"}, } - // TODO(adonovan): simplify after Go 1.6. - if go16 { - tests = append(tests, [2]string{ - gopath + "/src/vendor/golang.org/x/net/http2/hpack/hpack.go", - "vendor/golang.org/x/net/http2/hpack", - }) - } for _, test := range tests { file, want := test[0], test[1] bp, err := buildutil.ContainingPackage(&build.Default, ".", file) diff --git a/refactor/importgraph/go16_test.go b/refactor/importgraph/go16_test.go deleted file mode 100644 index 4c0c6939..00000000 --- a/refactor/importgraph/go16_test.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2015 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 !android -// +build go1.6 - -package importgraph_test - -func init() { - go16 = true -} diff --git a/refactor/importgraph/graph_test.go b/refactor/importgraph/graph_test.go index 21c845d3..52dd7695 100644 --- a/refactor/importgraph/graph_test.go +++ b/refactor/importgraph/graph_test.go @@ -9,10 +9,8 @@ package importgraph_test import ( - "fmt" "go/build" "sort" - "strings" "testing" "golang.org/x/tools/refactor/importgraph" @@ -22,8 +20,6 @@ import ( const this = "golang.org/x/tools/refactor/importgraph" -var go16 bool // Go version >= go1.6 - func TestBuild(t *testing.T) { forward, reverse, errors := importgraph.Build(&build.Default) @@ -49,14 +45,6 @@ func TestBuild(t *testing.T) { } } - // Test vendor packages appear under their absolute names. - if go16 { // hack: Go 1.6+ only - if !forward["net/http"]["vendor/golang.org/x/net/http2/hpack"] { - t.Errorf("forward[net/http] does not include vendor/golang.org/x/net/http2/hpack: %v", - strings.Replace(fmt.Sprint(forward["net/http"]), ":true", "", -1)) - } - } - // Test Search is reflexive. if !forward.Search(this)[this] { t.Errorf("irreflexive: forward.Search(importgraph)[importgraph] not found")