From 4db16973aa22c2c1a5a873261a68949f351efe2b Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Thu, 25 Apr 2024 16:23:30 -0400 Subject: [PATCH] go/packages/packagestest: fold modules_111.go into modules.go x/tools hasn't supported Go versions earlier than 1.11 (or even 1.11 itself) for a while. Change-Id: I723c43dbcd1c4df56d8c663a78ec31524b912985 Reviewed-on: https://go-review.googlesource.com/c/tools/+/581795 LUCI-TryBot-Result: Go LUCI Reviewed-by: Alan Donovan Auto-Submit: Alan Donovan --- go/packages/packagestest/export.go | 2 +- go/packages/packagestest/gopath.go | 4 ---- go/packages/packagestest/modules.go | 2 +- go/packages/packagestest/modules_111.go | 12 ------------ 4 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 go/packages/packagestest/modules_111.go diff --git a/go/packages/packagestest/export.go b/go/packages/packagestest/export.go index 3558ccfdd01..67d48562f4c 100644 --- a/go/packages/packagestest/export.go +++ b/go/packages/packagestest/export.go @@ -147,7 +147,7 @@ type Exporter interface { // All is the list of known exporters. // This is used by TestAll to run tests with all the exporters. -var All []Exporter +var All = []Exporter{GOPATH, Modules} // TestAll invokes the testing function once for each exporter registered in // the All global. diff --git a/go/packages/packagestest/gopath.go b/go/packages/packagestest/gopath.go index d56f523ed6f..c2e57a1545c 100644 --- a/go/packages/packagestest/gopath.go +++ b/go/packages/packagestest/gopath.go @@ -41,10 +41,6 @@ import ( // /sometemporarydirectory/repoa/src var GOPATH = gopath{} -func init() { - All = append(All, GOPATH) -} - type gopath struct{} func (gopath) Name() string { diff --git a/go/packages/packagestest/modules.go b/go/packages/packagestest/modules.go index 7eff9432086..089848c28bc 100644 --- a/go/packages/packagestest/modules.go +++ b/go/packages/packagestest/modules.go @@ -18,7 +18,7 @@ import ( ) // Modules is the exporter that produces module layouts. -// Each "repository" is put in it's own module, and the module file generated +// Each "repository" is put in its own module, and the module file generated // will have replace directives for all other modules. // Given the two files // diff --git a/go/packages/packagestest/modules_111.go b/go/packages/packagestest/modules_111.go deleted file mode 100644 index 4b976f6fd2a..00000000000 --- a/go/packages/packagestest/modules_111.go +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -//go:build go1.11 -// +build go1.11 - -package packagestest - -func init() { - All = append(All, Modules) -}