diff --git a/WORKSPACE b/WORKSPACE index 57237d7123..4240a8803c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -104,8 +104,8 @@ go_repository( go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=", - version = "v0.4.2", + sum = "h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=", + version = "v0.6.0-dev.0.20220419223038-86c51ed26bb4", ) go_repository( diff --git a/go/private/repositories.bzl b/go/private/repositories.bzl index 425baad0c7..4c35318779 100644 --- a/go/private/repositories.bzl +++ b/go/private/repositories.bzl @@ -64,13 +64,13 @@ def go_rules_dependencies(force = False): wrapper( http_archive, name = "org_golang_x_tools", - # v0.1.9, latest as of 2022-03-14 + # v0.1.11, latest as of 2022-07-14 urls = [ - "https://mirror.bazel.build/github.com/golang/tools/archive/v0.1.9.zip", - "https://github.com/golang/tools/archive/v0.1.9.zip", + "https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.1.11.zip", + "https://github.com/golang/tools/archive/refs/tags/v0.1.11.zip", ], - sha256 = "1d338afb3cd8013cfb035da6831dea2210efb0386c17b9c99b5e84724e3d733a", - strip_prefix = "tools-0.1.9", + sha256 = "d31521bddf3380e4ae2ae1ce6dcfca301bce6072527a07d612e13902c93916ef", + strip_prefix = "tools-0.1.11", patches = [ # deletegopls removes the gopls subdirectory. It contains a nested # module with additional dependencies. It's not needed by rules_go. diff --git a/go/tools/builders/BUILD.bazel b/go/tools/builders/BUILD.bazel index ec45446d1a..bb796883e7 100644 --- a/go/tools/builders/BUILD.bazel +++ b/go/tools/builders/BUILD.bazel @@ -81,6 +81,8 @@ go_source( "env.go", "flags.go", "nogo_main.go", + "nogo_typeparams_go117.go", + "nogo_typeparams_go118.go", "pack.go", ], # //go/tools/builders:nogo_srcs is considered a different target by diff --git a/go/tools/builders/nogo_main.go b/go/tools/builders/nogo_main.go index 97c683e10f..e33b490277 100644 --- a/go/tools/builders/nogo_main.go +++ b/go/tools/builders/nogo_main.go @@ -335,6 +335,9 @@ func load(packagePath string, imp *importer, filenames []string) (*goPackage, er Scopes: make(map[ast.Node]*types.Scope), Selections: make(map[*ast.SelectorExpr]*types.Selection), } + + initInstanceInfo(info) + types, err := config.Check(packagePath, pkg.fset, syntax, info) if err != nil { pkg.illTyped, pkg.typeCheckError = true, err diff --git a/go/tools/builders/nogo_typeparams_go117.go b/go/tools/builders/nogo_typeparams_go117.go new file mode 100644 index 0000000000..9b6fe9ac57 --- /dev/null +++ b/go/tools/builders/nogo_typeparams_go117.go @@ -0,0 +1,23 @@ +/* Copyright 2022 The Bazel Authors. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +//go:build !go1.18 +// +build !go1.18 + +package main + +import "go/types" + +func initInstanceInfo(*types.Info) {} diff --git a/go/tools/builders/nogo_typeparams_go118.go b/go/tools/builders/nogo_typeparams_go118.go new file mode 100644 index 0000000000..787b492a26 --- /dev/null +++ b/go/tools/builders/nogo_typeparams_go118.go @@ -0,0 +1,28 @@ +/* Copyright 2022 The Bazel Authors. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +//go:build go1.18 +// +build go1.18 + +package main + +import ( + "go/ast" + "go/types" +) + +func initInstanceInfo(info *types.Info) { + info.Instances = make(map[*ast.Ident]types.Instance) +} diff --git a/tests/core/nogo/generics/BUILD.bazel b/tests/core/nogo/generics/BUILD.bazel new file mode 100644 index 0000000000..a40df34561 --- /dev/null +++ b/tests/core/nogo/generics/BUILD.bazel @@ -0,0 +1,6 @@ +load("@io_bazel_rules_go//go/tools/bazel_testing:def.bzl", "go_bazel_test") + +go_bazel_test( + name = "generics_test", + srcs = ["generics_test.go"], +) diff --git a/tests/core/nogo/generics/README.rst b/tests/core/nogo/generics/README.rst new file mode 100644 index 0000000000..c348a9926f --- /dev/null +++ b/tests/core/nogo/generics/README.rst @@ -0,0 +1,18 @@ +nogo analyzers run against code using generics +============================================== + +.. _nogo: /go/nogo.rst +.. _buildssa: https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/buildssa +.. _nilness: https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/nilness + +Tests to ensure that `nogo`_ analyzers that run on code using generics get correct +type instantiation information. + +.. contents:: + +generics_test +------------- + +Verifies that code using generic types gets loaded including all type instantiation +information, so that analyzers based on the `buildssa`_ analyzer (such as `nilness`_) get +a complete picture of all types in the code. diff --git a/tests/core/nogo/generics/generics_test.go b/tests/core/nogo/generics/generics_test.go new file mode 100644 index 0000000000..562d52ed45 --- /dev/null +++ b/tests/core/nogo/generics/generics_test.go @@ -0,0 +1,85 @@ +// Copyright 2022 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package generics_test + +import ( + "bytes" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel_testing" +) + +func TestMain(m *testing.M) { + bazel_testing.TestMain(m, bazel_testing.Args{ + Nogo: "@//:nogo", + Main: ` +-- BUILD.bazel -- +load("@io_bazel_rules_go//go:def.bzl", "go_library", "nogo") + +nogo( + name = "nogo", + visibility = ["//visibility:public"], + deps = ["@org_golang_x_tools//go/analysis/passes/buildssa"], +) + +go_library( + name = "src", + srcs = ["src.go"], + importpath = "src", +) + +-- src.go -- +package src + +type Set[T comparable] struct { + m map[T]struct{} +} + +func New[T comparable](s ...T) *Set[T] { + set := &Set[T]{} + set.Add(s...) + return set +} + +func (set *Set[T]) Add(s ...T) { + if set.m == nil { + set.m = make(map[T]struct{}) + } + for _, s := range s { + set.m[s] = struct{}{} + } +} + +func S(x ...string) *Set[string] { + return New[string](x...) +} +`, + }) +} + +func Test(t *testing.T) { + cmd := bazel_testing.BazelCmd("build", "//:src") + var stderr bytes.Buffer + cmd.Stderr = &stderr + + if err := cmd.Run(); err != nil { + t.Log("output:", stderr.String()) + t.Fatal("unexpected error:", err) + } + + if bytes.Contains(stderr.Bytes(), []byte("panic")) { + t.Errorf("found panic in Bazel output: \n%s", stderr.String()) + } +} diff --git a/tests/integration/popular_repos/BUILD.bazel b/tests/integration/popular_repos/BUILD.bazel index 96aaaefbac..3c24a07d1e 100644 --- a/tests/integration/popular_repos/BUILD.bazel +++ b/tests/integration/popular_repos/BUILD.bazel @@ -185,6 +185,9 @@ test_suite( "@org_golang_x_tools//internal/jsonrpc2:jsonrpc2_test", "@org_golang_x_tools//internal/jsonrpc2/servertest:servertest_test", "@org_golang_x_tools//internal/jsonrpc2_v2:jsonrpc2_v2_test", + "@org_golang_x_tools//internal/lsp/bug:bug_test", + "@org_golang_x_tools//internal/lsp/debug:debug_test", + "@org_golang_x_tools//internal/lsp/lsppos:lsppos_test", "@org_golang_x_tools//internal/lsp/progress:progress_test", "@org_golang_x_tools//internal/lsp/regtest:regtest_test", "@org_golang_x_tools//internal/lsp/source/completion:completion_test", diff --git a/tests/integration/popular_repos/README.rst b/tests/integration/popular_repos/README.rst index adaad2d47a..c375a796bd 100644 --- a/tests/integration/popular_repos/README.rst +++ b/tests/integration/popular_repos/README.rst @@ -184,6 +184,9 @@ This runs tests from the repository `golang.org/x/tools diff -urN a/gopls/doc/command-line.md b/gopls/doc/command-line.md ---- a/gopls/doc/command-line.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/command-line.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/command-line.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/command-line.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -# Command line - @@ -1146,9 +1166,9 @@ diff -urN a/gopls/doc/command-line.md b/gopls/doc/command-line.md - -It is not a goal of `gopls` to be a high performance command line tool. Its command line is intended for single file/package user interaction speeds, not bulk processing. diff -urN a/gopls/doc/commands.md b/gopls/doc/commands.md ---- a/gopls/doc/commands.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/commands.md 1969-12-31 16:00:00.000000000 -0800 -@@ -1,370 +0,0 @@ +--- a/gopls/doc/commands.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/commands.md 1970-01-01 01:00:00.000000000 +0100 +@@ -1,436 +0,0 @@ -# Commands - -This document describes the LSP-level commands supported by `gopls`. They cannot be invoked directly by users, and all the details are subject to change, so nobody should rely on this information. @@ -1235,6 +1255,22 @@ diff -urN a/gopls/doc/commands.md b/gopls/doc/commands.md -} -``` - +-### **Run go mod edit -go=version** +-Identifier: `gopls.edit_go_directive` +- +-Runs `go mod edit -go=version` for a module. +- +-Args: +- +-``` +-{ +- // Any document URI within the relevant module. +- "URI": string, +- // The version to pass to `go mod edit -go`. +- "Version": string, +-} +-``` +- -### **Toggle gc_details** -Identifier: `gopls.gc_details` - @@ -1293,6 +1329,37 @@ diff -urN a/gopls/doc/commands.md b/gopls/doc/commands.md -} -``` - +-### **List imports of a file and its package** +-Identifier: `gopls.list_imports` +- +-Retrieve a list of imports in the given Go file, and the package it +-belongs to. +- +-Args: +- +-``` +-{ +- // The file URI. +- "URI": string, +-} +-``` +- +-Result: +- +-``` +-{ +- // Imports is a list of imports in the requested file. +- "Imports": []{ +- "Path": string, +- "Name": string, +- }, +- // PackageImports is a list of all imports in the requested file's package. +- "PackageImports": []{ +- "Path": string, +- }, +-} +-``` +- -### **List known packages** -Identifier: `gopls.list_known_packages` - @@ -1369,6 +1436,42 @@ diff -urN a/gopls/doc/commands.md b/gopls/doc/commands.md -} -``` - +-### **Run vulncheck (experimental)** +-Identifier: `gopls.run_vulncheck_exp` +- +-Run vulnerability check (`govulncheck`). +- +-Args: +- +-``` +-{ +- // Dir is the directory from which vulncheck will run from. +- "Dir": string, +- // Package pattern. E.g. "", ".", "./...". +- "Pattern": string, +-} +-``` +- +-Result: +- +-``` +-{ +- "Vuln": []{ +- "ID": string, +- "Details": string, +- "Aliases": []string, +- "Symbol": string, +- "PkgPath": string, +- "ModPath": string, +- "URL": string, +- "CurrentVersion": string, +- "FixedVersion": string, +- "CallStacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry, +- "CallStackSummaries": []string, +- }, +-} +-``` +- -### **Start the gopls debug server** -Identifier: `gopls.start_debugging` - @@ -1501,27 +1604,10 @@ diff -urN a/gopls/doc/commands.md b/gopls/doc/commands.md -} -``` - --### **Query workspace metadata** --Identifier: `gopls.workspace_metadata` -- --Query the server for information about active workspaces. -- --Result: -- --``` --{ -- // All workspaces for this session. -- "Workspaces": []{ -- "Name": string, -- "ModuleDir": string, -- }, --} --``` -- - diff -urN a/gopls/doc/contributing.md b/gopls/doc/contributing.md ---- a/gopls/doc/contributing.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/contributing.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/contributing.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/contributing.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,119 +0,0 @@ -# Documentation for contributors - @@ -1643,8 +1729,8 @@ diff -urN a/gopls/doc/contributing.md b/gopls/doc/contributing.md -[issue-gopls]: https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Agopls "gopls issues" -[issue-wanted]: https://github.com/golang/go/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Agopls+label%3A"help+wanted" "help wanted" diff -urN a/gopls/doc/daemon.md b/gopls/doc/daemon.md ---- a/gopls/doc/daemon.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/daemon.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/daemon.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/daemon.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,183 +0,0 @@ -# Running gopls as a daemon - @@ -1830,8 +1916,8 @@ diff -urN a/gopls/doc/daemon.md b/gopls/doc/daemon.md -change its configuration. These flags only matter for the forwarder process -that actually starts the daemon. diff -urN a/gopls/doc/design/design.md b/gopls/doc/design/design.md ---- a/gopls/doc/design/design.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/design/design.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/design/design.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/design/design.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,394 +0,0 @@ -# `gopls` design documentation - @@ -2228,8 +2314,8 @@ diff -urN a/gopls/doc/design/design.md b/gopls/doc/design/design.md -[`textDocument/typeDefinition`]: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#textDocument_typeDefinition -[`workspace/didChangeWatchedFiles`]: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#workspace_didChangeWatchedFiles diff -urN a/gopls/doc/design/implementation.md b/gopls/doc/design/implementation.md ---- a/gopls/doc/design/implementation.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/design/implementation.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/design/implementation.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/design/implementation.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,48 +0,0 @@ -# gopls implementation documentation - @@ -2280,8 +2366,8 @@ diff -urN a/gopls/doc/design/implementation.md b/gopls/doc/design/implementation -[internal/span]: https://github.com/golang/tools/tree/master/internal/span -[x/tools]: https://github.com/golang/tools diff -urN a/gopls/doc/design/integrating.md b/gopls/doc/design/integrating.md ---- a/gopls/doc/design/integrating.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/design/integrating.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/design/integrating.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/design/integrating.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,91 +0,0 @@ -# Documentation for plugin authors - @@ -2375,8 +2461,8 @@ diff -urN a/gopls/doc/design/integrating.md b/gopls/doc/design/integrating.md -[#31553]: https://github.com/golang/go/issues/31553 -[#31526]: https://github.com/golang/go/issues/31526 diff -urN a/gopls/doc/emacs.md b/gopls/doc/emacs.md ---- a/gopls/doc/emacs.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/emacs.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/emacs.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/emacs.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,183 +0,0 @@ -# Emacs - @@ -2562,8 +2648,8 @@ diff -urN a/gopls/doc/emacs.md b/gopls/doc/emacs.md -[settings]: settings.md -[Gophers slack]: https://invite.slack.golangbridge.org/ diff -urN a/gopls/doc/features.md b/gopls/doc/features.md ---- a/gopls/doc/features.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/features.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/features.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/features.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,55 +0,0 @@ -# Features - @@ -2621,8 +2707,8 @@ diff -urN a/gopls/doc/features.md b/gopls/doc/features.md - - diff -urN a/gopls/doc/generate.go b/gopls/doc/generate.go ---- a/gopls/doc/generate.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/generate.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/generate.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/generate.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,712 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -3060,7 +3146,7 @@ diff -urN a/gopls/doc/generate.go b/gopls/doc/generate.go - fmt.Fprintf(&b, "%s\t// %s\n", indent, line) - } - } -- tag := fld.JSONTag +- tag := strings.Split(fld.JSONTag, ",")[0] - if tag == "" { - tag = fld.Name - } @@ -3337,8 +3423,8 @@ diff -urN a/gopls/doc/generate.go b/gopls/doc/generate.go - return result, nil -} diff -urN a/gopls/doc/generate_test.go b/gopls/doc/generate_test.go ---- a/gopls/doc/generate_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/generate_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/generate_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/generate_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -3367,8 +3453,8 @@ diff -urN a/gopls/doc/generate_test.go b/gopls/doc/generate_test.go - } -} diff -urN a/gopls/doc/semantictokens.md b/gopls/doc/semantictokens.md ---- a/gopls/doc/semantictokens.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/semantictokens.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/semantictokens.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/semantictokens.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,121 +0,0 @@ -# Semantic Tokens - @@ -3493,8 +3579,8 @@ diff -urN a/gopls/doc/semantictokens.md b/gopls/doc/semantictokens.md -in the unedited part of the file, and they do. \ No newline at end of file diff -urN a/gopls/doc/settings.md b/gopls/doc/settings.md ---- a/gopls/doc/settings.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/settings.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/settings.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/settings.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,484 +0,0 @@ -# Settings - @@ -3685,7 +3771,7 @@ diff -urN a/gopls/doc/settings.md b/gopls/doc/settings.md - -codelenses overrides the enabled/disabled state of code lenses. See the -"Code Lenses" section of the --[Settings page](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) +-[Settings page](https://github.com/golang/tools/blob/master/gopls/doc/settings.md#code-lenses) -for the list of supported lenses. - -Example Usage: @@ -3752,7 +3838,7 @@ diff -urN a/gopls/doc/settings.md b/gopls/doc/settings.md - -**This setting is experimental and may be deleted.** - --experimentalPostfixCompletions enables artifical method snippets +-experimentalPostfixCompletions enables artificial method snippets -such as "someSlice.sort!". - -Default: `true`. @@ -3896,7 +3982,7 @@ diff -urN a/gopls/doc/settings.md b/gopls/doc/settings.md -* `"FastFuzzy"` -* `"Fuzzy"` - --Default: `"Fuzzy"`. +-Default: `"FastFuzzy"`. - -##### **symbolStyle** *enum* - @@ -3981,9 +4067,9 @@ diff -urN a/gopls/doc/settings.md b/gopls/doc/settings.md -Runs `go mod vendor` for a module. - diff -urN a/gopls/doc/subl.md b/gopls/doc/subl.md ---- a/gopls/doc/subl.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/subl.md 1969-12-31 16:00:00.000000000 -0800 -@@ -1,77 +0,0 @@ +--- a/gopls/doc/subl.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/subl.md 1970-01-01 01:00:00.000000000 +0100 +@@ -1,81 +0,0 @@ -# Sublime Text - -Use the [LSP] package. After installing it using Package Control, do the following: @@ -4042,6 +4128,10 @@ diff -urN a/gopls/doc/subl.md b/gopls/doc/subl.md - "settings": { - "LSP": { - "gopls": { +- // To use a specific version of gopls with Sublime Text LSP (e.g., to try new features in development) +- "command": [ +- "/path/to/your/go/bin/gopls" +- ], - "env": { - "PATH": "/path/to/your/go-dev/bin:/path/to/your/go/bin", - "GOPATH": "", @@ -4062,8 +4152,8 @@ diff -urN a/gopls/doc/subl.md b/gopls/doc/subl.md - -[LSP]: https://packagecontrol.io/packages/LSP diff -urN a/gopls/doc/troubleshooting.md b/gopls/doc/troubleshooting.md ---- a/gopls/doc/troubleshooting.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/troubleshooting.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/doc/troubleshooting.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/troubleshooting.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,48 +0,0 @@ -# Troubleshooting - @@ -4114,9 +4204,9 @@ diff -urN a/gopls/doc/troubleshooting.md b/gopls/doc/troubleshooting.md - -`gopls` automatically writes out memory debug information when your usage exceeds 1GB. This information can be found in your temporary directory with names like `gopls.1234-5GiB-withnames.zip`. On Windows, your temporary directory will be located at `%TMP%`, and on Unixes, it will be `$TMPDIR`, which is usually `/tmp`. Please [file an issue](#file-an-issue) with this memory debug information attached. If you are uncomfortable sharing the package names of your code, you can share the `-nonames` zip instead, but it's much less useful. diff -urN a/gopls/doc/vim.md b/gopls/doc/vim.md ---- a/gopls/doc/vim.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/doc/vim.md 1969-12-31 16:00:00.000000000 -0800 -@@ -1,229 +0,0 @@ +--- a/gopls/doc/vim.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/doc/vim.md 1970-01-01 01:00:00.000000000 +0100 +@@ -1,225 +0,0 @@ -# Vim / Neovim - -* [vim-go](#vimgo) @@ -4212,7 +4302,7 @@ diff -urN a/gopls/doc/vim.md b/gopls/doc/vim.md - "languageserver": { - "golang": { - "command": "gopls", -- "rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"], +- "rootPatterns": ["go.work", "go.mod", ".vim/", ".git/", ".hg/"], - "filetypes": ["go"], - "initializationOptions": { - "usePlaceholders": true @@ -4221,6 +4311,13 @@ diff -urN a/gopls/doc/vim.md b/gopls/doc/vim.md - } -``` - +-If you use `go.work` files, you may want to set the +-`workspace.workspaceFolderCheckCwd` option. This will force coc.nvim to search +-parent directories for `go.work` files, even if the current open directory has +-a `go.mod` file. See the +-[coc.nvim documentation](https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders) +-for more details. +- -Other [settings](settings.md) can be added in `initializationOptions` too. - -The `editor.action.organizeImport` code action will auto-format code and add missing imports. To run this automatically on save, add the following line to your `init.vim`: @@ -4260,8 +4357,12 @@ diff -urN a/gopls/doc/vim.md b/gopls/doc/vim.md -```vim -lua < ../ diff -urN a/gopls/go.sum b/gopls/go.sum ---- a/gopls/go.sum 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/go.sum 1969-12-31 16:00:00.000000000 -0800 -@@ -1,67 +0,0 @@ +--- a/gopls/go.sum 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/go.sum 1970-01-01 01:00:00.000000000 +0100 +@@ -1,95 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= --github.aaakk.us.kg/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +-github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= +-github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +-github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= --github.aaakk.us.kg/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= --github.aaakk.us.kg/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +-github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns= +-github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +-github.com/google/go-cmdtest v0.4.0/go.mod h1:apVn/GCasLZUVpAJ6oWAuyP7Ne7CEsQbTnc0plM3m+o= +-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +-github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +-github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/safehtml v0.0.2 h1:ZOt2VXg4x24bW0m2jtzAOkhoXV0iM8vNKc0paByCZqM= -github.com/google/safehtml v0.0.2/go.mod h1:L4KWwDsUJdECRAEpZoBn3O64bQaywRscowZjJAzjHnU= -github.com/jba/printsrc v0.2.2 h1:9OHK51UT+/iMAEBlQIIXW04qvKyF3/vvLuwW/hL8tDU= @@ -4475,13 +4592,18 @@ diff -urN a/gopls/go.sum b/gopls/go.sum -github.com/jba/templatecheck v0.6.0 h1:SwM8C4hlK/YNLsdcXStfnHWE2HKkuTVwy5FKQHt5ro8= -github.com/jba/templatecheck v0.6.0/go.mod h1:/1k7EajoSErFI9GLHAsiIJEaNLt3ALKNw2TV7z2SYv4= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +-github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +-github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= --github.aaakk.us.kg/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= --github.aaakk.us.kg/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +-github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +-github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +-github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -4490,10 +4612,16 @@ diff -urN a/gopls/go.sum b/gopls/go.sum -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= --golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= --golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= +-golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +-golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= +-golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +-golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +-golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -4501,14 +4629,19 @@ diff -urN a/gopls/go.sum b/gopls/go.sum -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= --golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +-golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +-golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +-golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +-golang.org/x/vuln v0.0.0-20220503210553-a5481fb0c8be h1:jokAF1mfylAi1iTQx7C44B7vyXUcSEMw8eDv0PzNu8s= +-golang.org/x/vuln v0.0.0-20220503210553-a5481fb0c8be/go.mod h1:twca1SxmF6/i2wHY/mj1vLIkkHdp+nil/yA32ZOP4kg= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= @@ -4520,15 +4653,18 @@ diff -urN a/gopls/go.sum b/gopls/go.sum -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= --honnef.co/go/tools v0.2.1 h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY= --honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= --mvdan.cc/gofumpt v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA= --mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= --mvdan.cc/xurls/v2 v2.3.0 h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I= --mvdan.cc/xurls/v2 v2.3.0/go.mod h1:AjuTy7gEiUArFMjgBBDU4SMxlfUYsRokpJQgNWOt3e4= +-honnef.co/go/tools v0.2.2/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= +-honnef.co/go/tools v0.3.0 h1:2LdYUZ7CIxnYgskbUZfY7FPggmqnh6shBqfWa8Tn3XU= +-honnef.co/go/tools v0.3.0/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= +-mvdan.cc/gofumpt v0.3.0 h1:kTojdZo9AcEYbQYhGuLf/zszYthRdhDNDUi2JKTxas4= +-mvdan.cc/gofumpt v0.3.0/go.mod h1:0+VyGZWleeIj5oostkOex+nDBA0eyavuDnDusAJ8ylo= +-mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5 h1:Jh3LAeMt1eGpxomyu3jVkmVZWW2MxZ1qIIV2TZ/nRio= +-mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= +-mvdan.cc/xurls/v2 v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc= +-mvdan.cc/xurls/v2 v2.4.0/go.mod h1:+GEjq9uNjqs8LQfM9nVnM8rff0OQ5Iash5rzX+N1CSg= diff -urN a/gopls/integration/govim/Dockerfile b/gopls/integration/govim/Dockerfile ---- a/gopls/integration/govim/Dockerfile 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/Dockerfile 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/Dockerfile 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -# Copyright 2019 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style @@ -4547,8 +4683,8 @@ diff -urN a/gopls/integration/govim/Dockerfile b/gopls/integration/govim/Dockerf -RUN git clone https://github.com/govim/govim /src/govim && cd /src/govim && \ - git checkout $GOVIM_REF diff -urN a/gopls/integration/govim/README.md b/gopls/integration/govim/README.md ---- a/gopls/integration/govim/README.md 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/README.md 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/README.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,47 +0,0 @@ -# govim integration tests - @@ -4598,8 +4734,8 @@ diff -urN a/gopls/integration/govim/README.md b/gopls/integration/govim/README.m - -[govim]: https://github.com/govim/govim diff -urN a/gopls/integration/govim/artifacts.go b/gopls/integration/govim/artifacts.go ---- a/gopls/integration/govim/artifacts.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/artifacts.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/artifacts.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/artifacts.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -4669,8 +4805,8 @@ diff -urN a/gopls/integration/govim/artifacts.go b/gopls/integration/govim/artif - return nil -} diff -urN a/gopls/integration/govim/cloudbuild.harness.yaml b/gopls/integration/govim/cloudbuild.harness.yaml ---- a/gopls/integration/govim/cloudbuild.harness.yaml 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/cloudbuild.harness.yaml 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/cloudbuild.harness.yaml 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/cloudbuild.harness.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -1,21 +0,0 @@ -# Copyright 2019 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style @@ -4694,8 +4830,8 @@ diff -urN a/gopls/integration/govim/cloudbuild.harness.yaml b/gopls/integration/ -images: - - gcr.io/$PROJECT_ID/govim-harness diff -urN a/gopls/integration/govim/cloudbuild.yaml b/gopls/integration/govim/cloudbuild.yaml ---- a/gopls/integration/govim/cloudbuild.yaml 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/cloudbuild.yaml 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/cloudbuild.yaml 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/cloudbuild.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -# Copyright 2019 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style @@ -4749,8 +4885,8 @@ diff -urN a/gopls/integration/govim/cloudbuild.yaml b/gopls/integration/govim/cl -# shared. -logsBucket: 'gs://${_RESULT_BUCKET}' diff -urN a/gopls/integration/govim/run_local.sh b/gopls/integration/govim/run_local.sh ---- a/gopls/integration/govim/run_local.sh 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/run_local.sh 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/run_local.sh 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/run_local.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,96 +0,0 @@ -#!/bin/bash -e - @@ -4767,7 +4903,7 @@ diff -urN a/gopls/integration/govim/run_local.sh b/gopls/integration/govim/run_l -Args: - --sudo run docker with sudo - --short run `go test` with `-short` -- --version run on the specific tagged Go version (or latest) rather +- --version run on the specific tagged govim version (or latest) rather - than the default branch - -Run govim tests against HEAD using local docker. @@ -4825,7 +4961,7 @@ diff -urN a/gopls/integration/govim/run_local.sh b/gopls/integration/govim/run_l -${SUDO_IF_NEEDED}docker run --rm -t \ - -v "${tools_dir}:/src/tools" \ - -w "/src/tools/gopls" \ -- golang:latest \ +- golang:rc \ - go build -o $(basename ${temp_gopls}) - -# Build the test harness. Here we are careful to pass in a very limited build @@ -4849,8 +4985,8 @@ diff -urN a/gopls/integration/govim/run_local.sh b/gopls/integration/govim/run_l - go test ${TEST_SHORT} ./cmd/govim \ - -gopls "/src/tools/gopls/${temp_gopls_name}" diff -urN a/gopls/integration/govim/run_tests_for_cloudbuild.sh b/gopls/integration/govim/run_tests_for_cloudbuild.sh ---- a/gopls/integration/govim/run_tests_for_cloudbuild.sh 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/integration/govim/run_tests_for_cloudbuild.sh 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/integration/govim/run_tests_for_cloudbuild.sh 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/integration/govim/run_tests_for_cloudbuild.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,28 +0,0 @@ -#!/bin/bash - @@ -4881,8 +5017,8 @@ diff -urN a/gopls/integration/govim/run_tests_for_cloudbuild.sh b/gopls/integrat - find "$GOVIM_TESTSCRIPT_WORKDIR_ROOT" -type d \( -name .vim -o -name gopath \) -prune -exec rm -rf '{}' \; -fi diff -urN a/gopls/internal/coverage/coverage.go b/gopls/internal/coverage/coverage.go ---- a/gopls/internal/coverage/coverage.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/coverage/coverage.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/coverage/coverage.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/coverage/coverage.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,261 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -5145,155 +5281,342 @@ diff -urN a/gopls/internal/coverage/coverage.go b/gopls/internal/coverage/covera - filepath.WalkDir(dir, f) - return ans -} -diff -urN a/gopls/internal/hooks/analysis.go b/gopls/internal/hooks/analysis.go ---- a/gopls/internal/hooks/analysis.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/analysis.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,60 +0,0 @@ --// Copyright 2019 The Go Authors. All rights reserved. +diff -urN a/gopls/internal/govulncheck/README.md b/gopls/internal/govulncheck/README.md +--- a/gopls/internal/govulncheck/README.md 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/README.md 1970-01-01 01:00:00.000000000 +0100 +@@ -1,17 +0,0 @@ +-# internal/govulncheck package +- +-This package is a literal copy of the cmd/govulncheck/internal/govulncheck +-package in the vuln repo (https://go.googlesource.com/vuln). +- +-The `copy.sh` does the copying, after removing all .go files here. To use it: +- +-1. Clone the vuln repo to a directory next to the directory holding this repo +- (tools). After doing that your directory structure should look something like +- ``` +- ~/repos/x/tools/gopls/... +- ~/repos/x/vuln/... +- ``` +- +-2. cd to this directory. +- +-3. Run `copy.sh`. +diff -urN a/gopls/internal/govulncheck/cache.go b/gopls/internal/govulncheck/cache.go +--- a/gopls/internal/govulncheck/cache.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/cache.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,138 +0,0 @@ +-// Copyright 2021 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.15 --// +build go1.15 +-//go:build go1.18 +-// +build go1.18 - --package hooks +-// Package govulncheck supports the govulncheck command. +-package govulncheck - -import ( -- "golang.org/x/tools/internal/lsp/protocol" -- "golang.org/x/tools/internal/lsp/source" -- "honnef.co/go/tools/analysis/lint" -- "honnef.co/go/tools/quickfix" -- "honnef.co/go/tools/simple" -- "honnef.co/go/tools/staticcheck" -- "honnef.co/go/tools/stylecheck" +- "encoding/json" +- "go/build" +- "io/ioutil" +- "os" +- "path/filepath" +- "sync" +- "time" +- +- "golang.org/x/vuln/client" +- "golang.org/x/vuln/osv" -) - --func updateAnalyzers(options *source.Options) { -- mapSeverity := func(severity lint.Severity) protocol.DiagnosticSeverity { -- switch severity { -- case lint.SeverityError: -- return protocol.SeverityError -- case lint.SeverityDeprecated: -- // TODO(dh): in LSP, deprecated is a tag, not a severity. -- // We'll want to support this once we enable SA5011. -- return protocol.SeverityWarning -- case lint.SeverityWarning: -- return protocol.SeverityWarning -- case lint.SeverityInfo: -- return protocol.SeverityInformation -- case lint.SeverityHint: -- return protocol.SeverityHint -- default: -- return protocol.SeverityWarning -- } -- } -- add := func(analyzers []*lint.Analyzer, skip map[string]struct{}) { -- for _, a := range analyzers { -- if _, ok := skip[a.Analyzer.Name]; ok { -- continue -- } +-// The cache uses a single JSON index file for each vulnerability database +-// which contains the map from packages to the time the last +-// vulnerability for that package was added/modified and the time that +-// the index was retrieved from the vulnerability database. The JSON +-// format is as follows: +-// +-// $GOPATH/pkg/mod/cache/download/vulndb/{db hostname}/indexes/index.json +-// { +-// Retrieved time.Time +-// Index client.DBIndex +-// } +-// +-// Each package also has a JSON file which contains the array of vulnerability +-// entries for the package. The JSON format is as follows: +-// +-// $GOPATH/pkg/mod/cache/download/vulndb/{db hostname}/{import path}/vulns.json +-// []*osv.Entry - -- enabled := !a.Doc.NonDefault -- options.AddStaticcheckAnalyzer(a.Analyzer, enabled, mapSeverity(a.Doc.Severity)) +-// FSCache is a thread-safe file-system cache implementing osv.Cache +-// +-// TODO: use something like cmd/go/internal/lockedfile for thread safety? +-type FSCache struct { +- mu sync.Mutex +- rootDir string +-} +- +-// Assert that *FSCache implements client.Cache. +-var _ client.Cache = (*FSCache)(nil) +- +-// use cfg.GOMODCACHE available in cmd/go/internal? +-var defaultCacheRoot = filepath.Join(build.Default.GOPATH, "/pkg/mod/cache/download/vulndb") +- +-func DefaultCache() *FSCache { +- return &FSCache{rootDir: defaultCacheRoot} +-} +- +-type cachedIndex struct { +- Retrieved time.Time +- Index client.DBIndex +-} +- +-func (c *FSCache) ReadIndex(dbName string) (client.DBIndex, time.Time, error) { +- c.mu.Lock() +- defer c.mu.Unlock() +- +- b, err := ioutil.ReadFile(filepath.Join(c.rootDir, dbName, "index.json")) +- if err != nil { +- if os.IsNotExist(err) { +- return nil, time.Time{}, nil - } +- return nil, time.Time{}, err - } +- var index cachedIndex +- if err := json.Unmarshal(b, &index); err != nil { +- return nil, time.Time{}, err +- } +- return index.Index, index.Retrieved, nil +-} - -- add(simple.Analyzers, nil) -- add(staticcheck.Analyzers, map[string]struct{}{ -- // This check conflicts with the vet printf check (golang/go#34494). -- "SA5009": {}, -- // This check relies on facts from dependencies, which -- // we don't currently compute. -- "SA5011": {}, +-func (c *FSCache) WriteIndex(dbName string, index client.DBIndex, retrieved time.Time) error { +- c.mu.Lock() +- defer c.mu.Unlock() +- +- path := filepath.Join(c.rootDir, dbName) +- if err := os.MkdirAll(path, 0755); err != nil { +- return err +- } +- j, err := json.Marshal(cachedIndex{ +- Index: index, +- Retrieved: retrieved, - }) -- add(stylecheck.Analyzers, nil) -- add(quickfix.Analyzers, nil) +- if err != nil { +- return err +- } +- if err := ioutil.WriteFile(filepath.Join(path, "index.json"), j, 0666); err != nil { +- return err +- } +- return nil -} -diff -urN a/gopls/internal/hooks/analysis_115.go b/gopls/internal/hooks/analysis_115.go ---- a/gopls/internal/hooks/analysis_115.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/analysis_115.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,12 +0,0 @@ --// Copyright 2021 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.15 --// +build !go1.15 +-func (c *FSCache) ReadEntries(dbName string, p string) ([]*osv.Entry, error) { +- c.mu.Lock() +- defer c.mu.Unlock() - --package hooks +- b, err := ioutil.ReadFile(filepath.Join(c.rootDir, dbName, p, "vulns.json")) +- if err != nil { +- if os.IsNotExist(err) { +- return nil, nil +- } +- return nil, err +- } +- var entries []*osv.Entry +- if err := json.Unmarshal(b, &entries); err != nil { +- return nil, err +- } +- return entries, nil +-} - --import "golang.org/x/tools/internal/lsp/source" +-func (c *FSCache) WriteEntries(dbName string, p string, entries []*osv.Entry) error { +- c.mu.Lock() +- defer c.mu.Unlock() - --func updateAnalyzers(_ *source.Options) {} -diff -urN a/gopls/internal/hooks/diff.go b/gopls/internal/hooks/diff.go ---- a/gopls/internal/hooks/diff.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/diff.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,41 +0,0 @@ --// Copyright 2019 The Go Authors. All rights reserved. +- path := filepath.Join(c.rootDir, dbName, p) +- if err := os.MkdirAll(path, 0777); err != nil { +- return err +- } +- j, err := json.Marshal(entries) +- if err != nil { +- return err +- } +- if err := ioutil.WriteFile(filepath.Join(path, "vulns.json"), j, 0666); err != nil { +- return err +- } +- return nil +-} +diff -urN a/gopls/internal/govulncheck/cache_test.go b/gopls/internal/govulncheck/cache_test.go +--- a/gopls/internal/govulncheck/cache_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/cache_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,165 +0,0 @@ +-// Copyright 2021 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. - --package hooks +-//go:build go1.18 +-// +build go1.18 +- +-package govulncheck - -import ( - "fmt" +- "os" +- "path/filepath" +- "reflect" +- "testing" +- "time" - -- "github.com/sergi/go-diff/diffmatchpatch" -- "golang.org/x/tools/internal/lsp/diff" -- "golang.org/x/tools/internal/span" +- "golang.org/x/sync/errgroup" +- "golang.org/x/vuln/client" +- "golang.org/x/vuln/osv" -) - --func ComputeEdits(uri span.URI, before, after string) (edits []diff.TextEdit, err error) { -- // The go-diff library has an unresolved panic (see golang/go#278774). -- // TODO(rstambler): Remove the recover once the issue has been fixed -- // upstream. -- defer func() { -- if r := recover(); r != nil { -- edits = nil -- err = fmt.Errorf("unable to compute edits for %s: %s", uri.Filename(), r) -- } -- }() -- diffs := diffmatchpatch.New().DiffMain(before, after, true) -- edits = make([]diff.TextEdit, 0, len(diffs)) -- offset := 0 -- for _, d := range diffs { -- start := span.NewPoint(0, 0, offset) -- switch d.Type { -- case diffmatchpatch.DiffDelete: -- offset += len(d.Text) -- edits = append(edits, diff.TextEdit{Span: span.New(uri, start, span.NewPoint(0, 0, offset))}) -- case diffmatchpatch.DiffEqual: -- offset += len(d.Text) -- case diffmatchpatch.DiffInsert: -- edits = append(edits, diff.TextEdit{Span: span.New(uri, start, span.Point{}), NewText: d.Text}) -- } +-func TestCache(t *testing.T) { +- tmpDir := t.TempDir() +- +- cache := &FSCache{rootDir: tmpDir} +- dbName := "vulndb.golang.org" +- +- _, _, err := cache.ReadIndex(dbName) +- if err != nil { +- t.Fatalf("ReadIndex failed for non-existent database: %v", err) +- } +- +- if err = os.Mkdir(filepath.Join(tmpDir, dbName), 0777); err != nil { +- t.Fatalf("os.Mkdir failed: %v", err) +- } +- _, _, err = cache.ReadIndex(dbName) +- if err != nil { +- t.Fatalf("ReadIndex failed for database without cached index: %v", err) +- } +- +- now := time.Now() +- expectedIdx := client.DBIndex{ +- "a.vuln.example.com": time.Time{}.Add(time.Hour), +- "b.vuln.example.com": time.Time{}.Add(time.Hour * 2), +- "c.vuln.example.com": time.Time{}.Add(time.Hour * 3), +- } +- if err = cache.WriteIndex(dbName, expectedIdx, now); err != nil { +- t.Fatalf("WriteIndex failed to write index: %v", err) +- } +- +- idx, retrieved, err := cache.ReadIndex(dbName) +- if err != nil { +- t.Fatalf("ReadIndex failed for database with cached index: %v", err) +- } +- if !reflect.DeepEqual(idx, expectedIdx) { +- t.Errorf("ReadIndex returned unexpected index, got:\n%s\nwant:\n%s", idx, expectedIdx) +- } +- if !retrieved.Equal(now) { +- t.Errorf("ReadIndex returned unexpected retrieved: got %s, want %s", retrieved, now) +- } +- +- if _, err = cache.ReadEntries(dbName, "vuln.example.com"); err != nil { +- t.Fatalf("ReadEntires failed for non-existent package: %v", err) +- } +- +- expectedEntries := []*osv.Entry{ +- {ID: "001"}, +- {ID: "002"}, +- {ID: "003"}, +- } +- if err := cache.WriteEntries(dbName, "vuln.example.com", expectedEntries); err != nil { +- t.Fatalf("WriteEntries failed: %v", err) +- } +- +- entries, err := cache.ReadEntries(dbName, "vuln.example.com") +- if err != nil { +- t.Fatalf("ReadEntries failed for cached package: %v", err) +- } +- if !reflect.DeepEqual(entries, expectedEntries) { +- t.Errorf("ReadEntries returned unexpected entries, got:\n%v\nwant:\n%v", entries, expectedEntries) - } -- return edits, nil -} -diff -urN a/gopls/internal/hooks/diff_test.go b/gopls/internal/hooks/diff_test.go ---- a/gopls/internal/hooks/diff_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/diff_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,16 +0,0 @@ --// Copyright 2019 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. - --package hooks_test +-func TestConcurrency(t *testing.T) { +- tmpDir := t.TempDir() - --import ( -- "testing" +- cache := &FSCache{rootDir: tmpDir} +- dbName := "vulndb.golang.org" - -- "golang.org/x/tools/gopls/internal/hooks" -- "golang.org/x/tools/internal/lsp/diff/difftest" --) +- g := new(errgroup.Group) +- for i := 0; i < 1000; i++ { +- i := i +- g.Go(func() error { +- id := i % 5 +- p := fmt.Sprintf("package%d", id) - --func TestDiff(t *testing.T) { -- difftest.DiffTest(t, hooks.ComputeEdits) +- entries, err := cache.ReadEntries(dbName, p) +- if err != nil { +- return err +- } +- +- err = cache.WriteEntries(dbName, p, append(entries, &osv.Entry{ID: fmt.Sprint(id)})) +- if err != nil { +- return err +- } +- return nil +- }) +- } +- +- if err := g.Wait(); err != nil { +- t.Errorf("error in parallel cache entries read/write: %v", err) +- } +- +- // sanity checking +- for i := 0; i < 5; i++ { +- id := fmt.Sprint(i) +- p := fmt.Sprintf("package%s", id) +- +- es, err := cache.ReadEntries(dbName, p) +- if err != nil { +- t.Fatalf("failed to read entries: %v", err) +- } +- for _, e := range es { +- if e.ID != id { +- t.Errorf("want %s ID for vuln entry; got %s", id, e.ID) +- } +- } +- } +- +- // do similar for cache index +- start := time.Now() +- for i := 0; i < 1000; i++ { +- i := i +- g.Go(func() error { +- id := i % 5 +- p := fmt.Sprintf("package%v", id) +- +- idx, _, err := cache.ReadIndex(dbName) +- if err != nil { +- return err +- } +- +- if idx == nil { +- idx = client.DBIndex{} +- } +- +- // sanity checking +- if rt, ok := idx[p]; ok && rt.Before(start) { +- return fmt.Errorf("unexpected past time in index: %v before start %v", rt, start) +- } +- +- now := time.Now() +- idx[p] = now +- if err := cache.WriteIndex(dbName, idx, now); err != nil { +- return err +- } +- return nil +- }) +- } +- +- if err := g.Wait(); err != nil { +- t.Errorf("error in parallel cache index read/write: %v", err) +- } -} -diff -urN a/gopls/internal/hooks/gen-licenses.sh b/gopls/internal/hooks/gen-licenses.sh ---- a/gopls/internal/hooks/gen-licenses.sh 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/gen-licenses.sh 1969-12-31 16:00:00.000000000 -0800 -@@ -1,38 +0,0 @@ +diff -urN a/gopls/internal/govulncheck/copy.sh b/gopls/internal/govulncheck/copy.sh +--- a/gopls/internal/govulncheck/copy.sh 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/copy.sh 1970-01-01 01:00:00.000000000 +0100 +@@ -1,13 +0,0 @@ -#!/bin/bash -eu - -# Copyright 2020 The Go Authors. All rights reserved. @@ -5302,553 +5625,1055 @@ diff -urN a/gopls/internal/hooks/gen-licenses.sh b/gopls/internal/hooks/gen-lice - -set -o pipefail - --output=$1 --tempfile=$(mktemp) --cd $(dirname $0) +-# Copy golang.org/x/vuln/cmd/govulncheck/internal/govulncheck into this directory. +-# Assume the x/vuln repo is a sibling of the tools repo. - --cat > $tempfile <> $tempfile -- echo >> $tempfile -- sed 's/^-- / &/' $dir/$license >> $tempfile -- echo >> $tempfile --done -- --echo "\`" >> $tempfile --mv $tempfile $output -\ No newline at end of file -diff -urN a/gopls/internal/hooks/hooks.go b/gopls/internal/hooks/hooks.go ---- a/gopls/internal/hooks/hooks.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/hooks.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,37 +0,0 @@ --// Copyright 2019 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.18 +-// +build go1.18 - --// Package hooks adds all the standard gopls implementations. --// This can be used in tests without needing to use the gopls main, and is --// also the place to edit for custom builds of gopls. --package hooks // import "golang.org/x/tools/gopls/internal/hooks" +-package govulncheck - -import ( - "context" -- "regexp" +- "fmt" +- "sort" +- "strings" - -- "golang.org/x/tools/internal/lsp/source" -- "mvdan.cc/gofumpt/format" -- "mvdan.cc/xurls/v2" +- "golang.org/x/tools/go/packages" +- "golang.org/x/vuln/client" +- "golang.org/x/vuln/vulncheck" -) - --func Options(options *source.Options) { -- options.LicensesText = licensesText -- if options.GoDiff { -- options.ComputeEdits = ComputeEdits +-// A PackageError contains errors from loading a set of packages. +-type PackageError struct { +- Errors []packages.Error +-} +- +-func (e *PackageError) Error() string { +- var b strings.Builder +- fmt.Fprintln(&b, "Packages contain errors:") +- for _, e := range e.Errors { +- fmt.Println(&b, e) +- } +- return b.String() +-} +- +-// LoadPackages loads the packages matching patterns using cfg, after setting +-// the cfg mode flags that vulncheck needs for analysis. +-// If the packages contain errors, a PackageError is returned containing a list of the errors, +-// along with the packages themselves. +-func LoadPackages(cfg *packages.Config, patterns ...string) ([]*vulncheck.Package, error) { +- cfg.Mode |= packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | +- packages.NeedImports | packages.NeedTypes | packages.NeedTypesSizes | +- packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedDeps | +- packages.NeedModule +- +- pkgs, err := packages.Load(cfg, patterns...) +- vpkgs := vulncheck.Convert(pkgs) +- if err != nil { +- return nil, err - } -- options.URLRegexp = relaxedFullWord -- options.GofumptFormat = func(ctx context.Context, src []byte) ([]byte, error) { -- return format.Source(src, format.Options{}) +- var perrs []packages.Error +- packages.Visit(pkgs, nil, func(p *packages.Package) { +- perrs = append(perrs, p.Errors...) +- }) +- if len(perrs) > 0 { +- err = &PackageError{perrs} - } -- updateAnalyzers(options) +- return vpkgs, err -} - --var relaxedFullWord *regexp.Regexp +-// Source calls vulncheck.Source on the Go source in pkgs. It returns the result +-// with Vulns trimmed to those that are actually called. +-func Source(ctx context.Context, pkgs []*vulncheck.Package, c client.Client) (*vulncheck.Result, error) { +- r, err := vulncheck.Source(ctx, pkgs, &vulncheck.Config{Client: c}) +- if err != nil { +- return nil, err +- } +- // Keep only the vulns that are called. +- var vulns []*vulncheck.Vuln +- for _, v := range r.Vulns { +- if v.CallSink != 0 { +- vulns = append(vulns, v) +- } +- } +- r.Vulns = vulns +- return r, nil +-} - --// Ensure links are matched as full words, not anywhere. --func init() { -- relaxedFullWord = regexp.MustCompile(`\b(` + xurls.Relaxed().String() + `)\b`) -- relaxedFullWord.Longest() +-// CallInfo is information about calls to vulnerable functions. +-type CallInfo struct { +- CallStacks map[*vulncheck.Vuln][]vulncheck.CallStack // all call stacks +- VulnGroups [][]*vulncheck.Vuln // vulns grouped by ID and package +- ModuleVersions map[string]string // map from module paths to versions +- TopPackages map[string]bool // top-level packages -} -diff -urN a/gopls/internal/hooks/licenses.go b/gopls/internal/hooks/licenses.go ---- a/gopls/internal/hooks/licenses.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/licenses.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,169 +0,0 @@ --// Copyright 2020 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:generate ./gen-licenses.sh licenses.go --package hooks +-// GetCallInfo computes call stacks and related information from a vulncheck.Result. +-// I also makes a set of top-level packages from pkgs. +-func GetCallInfo(r *vulncheck.Result, pkgs []*vulncheck.Package) *CallInfo { +- pset := map[string]bool{} +- for _, p := range pkgs { +- pset[p.PkgPath] = true +- } +- return &CallInfo{ +- CallStacks: vulncheck.CallStacks(r), +- VulnGroups: groupByIDAndPackage(r.Vulns), +- ModuleVersions: moduleVersionMap(r.Modules), +- TopPackages: pset, +- } +-} - --const licensesText = ` ---- github.com/BurntSushi/toml COPYING -- +-func groupByIDAndPackage(vs []*vulncheck.Vuln) [][]*vulncheck.Vuln { +- groups := map[[2]string][]*vulncheck.Vuln{} +- for _, v := range vs { +- key := [2]string{v.OSV.ID, v.PkgPath} +- groups[key] = append(groups[key], v) +- } - --The MIT License (MIT) +- var res [][]*vulncheck.Vuln +- for _, g := range groups { +- res = append(res, g) +- } +- sort.Slice(res, func(i, j int) bool { +- return res[i][0].PkgPath < res[j][0].PkgPath +- }) +- return res +-} - --Copyright (c) 2013 TOML authors +-// moduleVersionMap builds a map from module paths to versions. +-func moduleVersionMap(mods []*vulncheck.Module) map[string]string { +- moduleVersions := map[string]string{} +- for _, m := range mods { +- v := m.Version +- if m.Replace != nil { +- v = m.Replace.Version +- } +- moduleVersions[m.Path] = v +- } +- return moduleVersions +-} +diff -urN a/gopls/internal/govulncheck/util.go b/gopls/internal/govulncheck/util.go +--- a/gopls/internal/govulncheck/util.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/util.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,109 +0,0 @@ +-// Copyright 2022 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. - --Permission is hereby granted, free of charge, to any person obtaining a copy --of this software and associated documentation files (the "Software"), to deal --in the Software without restriction, including without limitation the rights --to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --copies of the Software, and to permit persons to whom the Software is --furnished to do so, subject to the following conditions: +-//go:build go1.18 +-// +build go1.18 - --The above copyright notice and this permission notice shall be included in --all copies or substantial portions of the Software. +-package govulncheck - --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --THE SOFTWARE. +-import ( +- "fmt" +- "strings" - ---- github.com/google/go-cmp LICENSE -- +- "golang.org/x/mod/semver" +- "golang.org/x/vuln/osv" +- "golang.org/x/vuln/vulncheck" +-) - --Copyright (c) 2017 The Go Authors. All rights reserved. +-// LatestFixed returns the latest fixed version in the list of affected ranges, +-// or the empty string if there are no fixed versions. +-func LatestFixed(as []osv.Affected) string { +- v := "" +- for _, a := range as { +- for _, r := range a.Ranges { +- if r.Type == osv.TypeSemver { +- for _, e := range r.Events { +- if e.Fixed != "" && (v == "" || semver.Compare(e.Fixed, v) > 0) { +- v = e.Fixed +- } +- } +- } +- } +- } +- return v +-} - --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are --met: +-// SummarizeCallStack returns a short description of the call stack. +-// It uses one of two forms, depending on what the lowest function F in topPkgs +-// calls: +-// - If it calls a function V from the vulnerable package, then summarizeCallStack +-// returns "F calls V". +-// - If it calls a function G in some other package, which eventually calls V, +-// it returns "F calls G, which eventually calls V". +-// +-// If it can't find any of these functions, summarizeCallStack returns the empty string. +-func SummarizeCallStack(cs vulncheck.CallStack, topPkgs map[string]bool, vulnPkg string) string { +- // Find the lowest function in the top packages. +- iTop := lowest(cs, func(e vulncheck.StackEntry) bool { +- return topPkgs[PkgPath(e.Function)] +- }) +- if iTop < 0 { +- return "" +- } +- // Find the highest function in the vulnerable package that is below iTop. +- iVuln := highest(cs[iTop+1:], func(e vulncheck.StackEntry) bool { +- return PkgPath(e.Function) == vulnPkg +- }) +- if iVuln < 0 { +- return "" +- } +- iVuln += iTop + 1 // adjust for slice in call to highest. +- topName := FuncName(cs[iTop].Function) +- vulnName := FuncName(cs[iVuln].Function) +- if iVuln == iTop+1 { +- return fmt.Sprintf("%s calls %s", topName, vulnName) +- } +- return fmt.Sprintf("%s calls %s, which eventually calls %s", +- topName, FuncName(cs[iTop+1].Function), vulnName) +-} - -- * Redistributions of source code must retain the above copyright --notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above --copyright notice, this list of conditions and the following disclaimer --in the documentation and/or other materials provided with the --distribution. -- * Neither the name of Google Inc. nor the names of its --contributors may be used to endorse or promote products derived from --this software without specific prior written permission. +-// highest returns the highest (one with the smallest index) entry in the call +-// stack for which f returns true. +-func highest(cs vulncheck.CallStack, f func(e vulncheck.StackEntry) bool) int { +- for i := 0; i < len(cs); i++ { +- if f(cs[i]) { +- return i +- } +- } +- return -1 +-} - --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-// lowest returns the lowest (one with the largets index) entry in the call +-// stack for which f returns true. +-func lowest(cs vulncheck.CallStack, f func(e vulncheck.StackEntry) bool) int { +- for i := len(cs) - 1; i >= 0; i-- { +- if f(cs[i]) { +- return i +- } +- } +- return -1 +-} - ---- github.com/sergi/go-diff LICENSE -- +-// PkgPath returns the package path from fn. +-func PkgPath(fn *vulncheck.FuncNode) string { +- if fn.PkgPath != "" { +- return fn.PkgPath +- } +- s := strings.TrimPrefix(fn.RecvType, "*") +- if i := strings.LastIndexByte(s, '.'); i > 0 { +- s = s[:i] +- } +- return s +-} - --Copyright (c) 2012-2016 The go-diff Authors. All rights reserved. +-// FuncName returns the function name from fn, adjusted +-// to remove pointer annotations. +-func FuncName(fn *vulncheck.FuncNode) string { +- return strings.TrimPrefix(fn.String(), "*") +-} +diff -urN a/gopls/internal/govulncheck/util_test.go b/gopls/internal/govulncheck/util_test.go +--- a/gopls/internal/govulncheck/util_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/govulncheck/util_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,85 +0,0 @@ +-// Copyright 2022 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. - --Permission is hereby granted, free of charge, to any person obtaining a --copy of this software and associated documentation files (the "Software"), --to deal in the Software without restriction, including without limitation --the rights to use, copy, modify, merge, publish, distribute, sublicense, --and/or sell copies of the Software, and to permit persons to whom the --Software is furnished to do so, subject to the following conditions: +-//go:build go1.18 +-// +build go1.18 - --The above copyright notice and this permission notice shall be included --in all copies or substantial portions of the Software. -- --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING --FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER --DEALINGS IN THE SOFTWARE. +-package govulncheck - +-import ( +- "strings" +- "testing" - ---- honnef.co/go/tools LICENSE -- +- "golang.org/x/vuln/vulncheck" +-) - --Copyright (c) 2016 Dominik Honnef +-func TestPkgPath(t *testing.T) { +- for _, test := range []struct { +- in vulncheck.FuncNode +- want string +- }{ +- { +- vulncheck.FuncNode{PkgPath: "math", Name: "Floor"}, +- "math", +- }, +- { +- vulncheck.FuncNode{RecvType: "a.com/b.T", Name: "M"}, +- "a.com/b", +- }, +- { +- vulncheck.FuncNode{RecvType: "*a.com/b.T", Name: "M"}, +- "a.com/b", +- }, +- } { +- got := PkgPath(&test.in) +- if got != test.want { +- t.Errorf("%+v: got %q, want %q", test.in, got, test.want) +- } +- } +-} - --Permission is hereby granted, free of charge, to any person obtaining --a copy of this software and associated documentation files (the --"Software"), to deal in the Software without restriction, including --without limitation the rights to use, copy, modify, merge, publish, --distribute, sublicense, and/or sell copies of the Software, and to --permit persons to whom the Software is furnished to do so, subject to --the following conditions: +-func TestSummarizeCallStack(t *testing.T) { +- topPkgs := map[string]bool{"t1": true, "t2": true} +- vulnPkg := "v" - --The above copyright notice and this permission notice shall be --included in all copies or substantial portions of the Software. +- for _, test := range []struct { +- in, want string +- }{ +- {"a.F", ""}, +- {"t1.F", ""}, +- {"v.V", ""}, +- { +- "t1.F v.V", +- "t1.F calls v.V", +- }, +- { +- "t1.F t2.G v.V1 v.v2", +- "t2.G calls v.V1", +- }, +- { +- "t1.F x.Y t2.G a.H b.I c.J v.V", +- "t2.G calls a.H, which eventually calls v.V", +- }, +- } { +- in := stringToCallStack(test.in) +- got := SummarizeCallStack(in, topPkgs, vulnPkg) +- if got != test.want { +- t.Errorf("%s:\ngot %s\nwant %s", test.in, got, test.want) +- } +- } +-} - --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, --EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND --NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE --LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION --OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION --WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-func stringToCallStack(s string) vulncheck.CallStack { +- var cs vulncheck.CallStack +- for _, e := range strings.Fields(s) { +- parts := strings.Split(e, ".") +- cs = append(cs, vulncheck.StackEntry{ +- Function: &vulncheck.FuncNode{ +- PkgPath: parts[0], +- Name: parts[1], +- }, +- }) +- } +- return cs +-} +diff -urN a/gopls/internal/hooks/analysis.go b/gopls/internal/hooks/analysis.go +--- a/gopls/internal/hooks/analysis.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/analysis.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,62 +0,0 @@ +-// Copyright 2019 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. - ---- mvdan.cc/gofumpt LICENSE -- +-//go:build go1.17 +-// +build go1.17 - --Copyright (c) 2019, Daniel Martí. All rights reserved. +-package hooks - --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are --met: +-import ( +- "golang.org/x/tools/internal/lsp/protocol" +- "golang.org/x/tools/internal/lsp/source" +- "honnef.co/go/tools/analysis/lint" +- "honnef.co/go/tools/quickfix" +- "honnef.co/go/tools/simple" +- "honnef.co/go/tools/staticcheck" +- "honnef.co/go/tools/stylecheck" +-) - -- * Redistributions of source code must retain the above copyright --notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above --copyright notice, this list of conditions and the following disclaimer --in the documentation and/or other materials provided with the --distribution. -- * Neither the name of the copyright holder nor the names of its --contributors may be used to endorse or promote products derived from --this software without specific prior written permission. +-func updateAnalyzers(options *source.Options) { +- options.StaticcheckSupported = true - --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- mapSeverity := func(severity lint.Severity) protocol.DiagnosticSeverity { +- switch severity { +- case lint.SeverityError: +- return protocol.SeverityError +- case lint.SeverityDeprecated: +- // TODO(dh): in LSP, deprecated is a tag, not a severity. +- // We'll want to support this once we enable SA5011. +- return protocol.SeverityWarning +- case lint.SeverityWarning: +- return protocol.SeverityWarning +- case lint.SeverityInfo: +- return protocol.SeverityInformation +- case lint.SeverityHint: +- return protocol.SeverityHint +- default: +- return protocol.SeverityWarning +- } +- } +- add := func(analyzers []*lint.Analyzer, skip map[string]struct{}) { +- for _, a := range analyzers { +- if _, ok := skip[a.Analyzer.Name]; ok { +- continue +- } - ---- mvdan.cc/xurls/v2 LICENSE -- +- enabled := !a.Doc.NonDefault +- options.AddStaticcheckAnalyzer(a.Analyzer, enabled, mapSeverity(a.Doc.Severity)) +- } +- } - --Copyright (c) 2015, Daniel Martí. All rights reserved. +- add(simple.Analyzers, nil) +- add(staticcheck.Analyzers, map[string]struct{}{ +- // This check conflicts with the vet printf check (golang/go#34494). +- "SA5009": {}, +- // This check relies on facts from dependencies, which +- // we don't currently compute. +- "SA5011": {}, +- }) +- add(stylecheck.Analyzers, nil) +- add(quickfix.Analyzers, nil) +-} +diff -urN a/gopls/internal/hooks/analysis_117.go b/gopls/internal/hooks/analysis_117.go +--- a/gopls/internal/hooks/analysis_117.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/analysis_117.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,14 +0,0 @@ +-// Copyright 2021 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. - --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are --met: +-//go:build !go1.17 +-// +build !go1.17 - -- * Redistributions of source code must retain the above copyright --notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above --copyright notice, this list of conditions and the following disclaimer --in the documentation and/or other materials provided with the --distribution. -- * Neither the name of the copyright holder nor the names of its --contributors may be used to endorse or promote products derived from --this software without specific prior written permission. +-package hooks - --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-import "golang.org/x/tools/internal/lsp/source" - --` -diff -urN a/gopls/internal/hooks/licenses_test.go b/gopls/internal/hooks/licenses_test.go ---- a/gopls/internal/hooks/licenses_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/hooks/licenses_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,46 +0,0 @@ --// Copyright 2020 The Go Authors. All rights reserved. +-func updateAnalyzers(options *source.Options) { +- options.StaticcheckSupported = false +-} +diff -urN a/gopls/internal/hooks/diff.go b/gopls/internal/hooks/diff.go +--- a/gopls/internal/hooks/diff.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/diff.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,41 +0,0 @@ +-// Copyright 2019 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. - -package hooks - -import ( -- "bytes" -- "io/ioutil" -- "os/exec" -- "runtime" -- "testing" +- "fmt" - -- "golang.org/x/tools/internal/testenv" +- "github.com/sergi/go-diff/diffmatchpatch" +- "golang.org/x/tools/internal/lsp/diff" +- "golang.org/x/tools/internal/span" -) - --func TestLicenses(t *testing.T) { -- // License text differs for older Go versions because staticcheck isn't -- // supported for those versions. -- testenv.NeedsGo1Point(t, 15) -- -- if runtime.GOOS != "linux" && runtime.GOOS != "darwin" { -- t.Skip("generating licenses only works on Unixes") -- } -- tmp, err := ioutil.TempFile("", "") -- if err != nil { -- t.Fatal(err) -- } -- tmp.Close() -- -- if out, err := exec.Command("./gen-licenses.sh", tmp.Name()).CombinedOutput(); err != nil { -- t.Fatalf("generating licenses failed: %q, %v", out, err) -- } -- -- got, err := ioutil.ReadFile(tmp.Name()) -- if err != nil { -- t.Fatal(err) -- } -- want, err := ioutil.ReadFile("licenses.go") -- if err != nil { -- t.Fatal(err) -- } -- if !bytes.Equal(got, want) { -- t.Error("combined license text needs updating. Run: `go generate ./internal/hooks` from the gopls module.") +-func ComputeEdits(uri span.URI, before, after string) (edits []diff.TextEdit, err error) { +- // The go-diff library has an unresolved panic (see golang/go#278774). +- // TODO(rstambler): Remove the recover once the issue has been fixed +- // upstream. +- defer func() { +- if r := recover(); r != nil { +- edits = nil +- err = fmt.Errorf("unable to compute edits for %s: %s", uri.Filename(), r) +- } +- }() +- diffs := diffmatchpatch.New().DiffMain(before, after, true) +- edits = make([]diff.TextEdit, 0, len(diffs)) +- offset := 0 +- for _, d := range diffs { +- start := span.NewPoint(0, 0, offset) +- switch d.Type { +- case diffmatchpatch.DiffDelete: +- offset += len(d.Text) +- edits = append(edits, diff.TextEdit{Span: span.New(uri, start, span.NewPoint(0, 0, offset))}) +- case diffmatchpatch.DiffEqual: +- offset += len(d.Text) +- case diffmatchpatch.DiffInsert: +- edits = append(edits, diff.TextEdit{Span: span.New(uri, start, span.Point{}), NewText: d.Text}) +- } - } +- return edits, nil -} -diff -urN a/gopls/internal/regtest/bench/bench_test.go b/gopls/internal/regtest/bench/bench_test.go ---- a/gopls/internal/regtest/bench/bench_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/bench/bench_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,190 +0,0 @@ --// Copyright 2020 The Go Authors. All rights reserved. +diff -urN a/gopls/internal/hooks/diff_test.go b/gopls/internal/hooks/diff_test.go +--- a/gopls/internal/hooks/diff_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/diff_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,16 +0,0 @@ +-// Copyright 2019 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. - --package bench +-package hooks_test - -import ( -- "flag" -- "fmt" -- "os" -- "runtime/pprof" - "testing" - - "golang.org/x/tools/gopls/internal/hooks" -- "golang.org/x/tools/internal/lsp/fake" -- . "golang.org/x/tools/internal/lsp/regtest" -- -- "golang.org/x/tools/internal/lsp/protocol" +- "golang.org/x/tools/internal/lsp/diff/difftest" -) - --func TestMain(m *testing.M) { -- Main(m, hooks.Options) +-func TestDiff(t *testing.T) { +- difftest.DiffTest(t, hooks.ComputeEdits) -} +diff -urN a/gopls/internal/hooks/gen-licenses.sh b/gopls/internal/hooks/gen-licenses.sh +--- a/gopls/internal/hooks/gen-licenses.sh 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/gen-licenses.sh 1970-01-01 01:00:00.000000000 +0100 +@@ -1,38 +0,0 @@ +-#!/bin/bash -eu - --func benchmarkOptions(dir string) []RunOption { -- return []RunOption{ -- // Run in an existing directory, since we're trying to simulate known cases -- // that cause gopls memory problems. -- InExistingDir(dir), -- // Skip logs as they buffer up memory unnaturally. -- SkipLogs(), -- // The Debug server only makes sense if running in singleton mode. -- Modes(Singleton), -- // Remove the default timeout. Individual tests should control their -- // own graceful termination. -- NoDefaultTimeout(), -- -- // Use the actual proxy, since we want our builds to succeed. -- GOPROXY("https://proxy.golang.org"), -- } --} -- --func printBenchmarkResults(result testing.BenchmarkResult) { -- fmt.Printf("BenchmarkStatistics\t%s\t%s\n", result.String(), result.MemString()) --} -- --var iwlOptions struct { -- workdir string --} -- --func init() { -- flag.StringVar(&iwlOptions.workdir, "iwl_workdir", "", "if set, run IWL benchmark in this directory") --} -- --func TestBenchmarkIWL(t *testing.T) { -- if iwlOptions.workdir == "" { -- t.Skip("-iwl_workdir not configured") -- } -- -- opts := stressTestOptions(iwlOptions.workdir) -- // Don't skip hooks, so that we can wait for IWL. -- opts = append(opts, SkipHooks(false)) +-# Copyright 2020 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. - -- results := testing.Benchmark(func(b *testing.B) { -- for i := 0; i < b.N; i++ { -- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) {}) -- } -- }) +-set -o pipefail - -- printBenchmarkResults(results) --} +-output=$1 +-tempfile=$(mktemp) +-cd $(dirname $0) - --var symbolOptions struct { -- workdir, query, matcher, style string -- printResults bool --} +-cat > $tempfile <> $tempfile +- echo >> $tempfile +- sed 's/^-- / &/' $dir/$license >> $tempfile +- echo >> $tempfile +-done - -- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) { -- // We can't Await in this test, since we have disabled hooks. Instead, run -- // one symbol request to completion to ensure all necessary cache entries -- // are populated. -- symbols, err := env.Editor.Server.Symbol(env.Ctx, &protocol.WorkspaceSymbolParams{ -- Query: symbolOptions.query, -- }) -- if err != nil { -- t.Fatal(err) -- } +-echo "\`" >> $tempfile +-mv $tempfile $output +\ No newline at end of file +diff -urN a/gopls/internal/hooks/hooks.go b/gopls/internal/hooks/hooks.go +--- a/gopls/internal/hooks/hooks.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/hooks.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,34 +0,0 @@ +-// Copyright 2019 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. - -- if symbolOptions.printResults { -- fmt.Println("Results:") -- for i := 0; i < len(symbols); i++ { -- fmt.Printf("\t%d. %s (%s)\n", i, symbols[i].Name, symbols[i].ContainerName) -- } -- } +-// Package hooks adds all the standard gopls implementations. +-// This can be used in tests without needing to use the gopls main, and is +-// also the place to edit for custom builds of gopls. +-package hooks // import "golang.org/x/tools/gopls/internal/hooks" - -- results := testing.Benchmark(func(b *testing.B) { -- for i := 0; i < b.N; i++ { -- if _, err := env.Editor.Server.Symbol(env.Ctx, &protocol.WorkspaceSymbolParams{ -- Query: symbolOptions.query, -- }); err != nil { -- t.Fatal(err) -- } -- } -- }) -- printBenchmarkResults(results) -- }) --} +-import ( +- "context" - --var ( -- benchDir = flag.String("didchange_dir", "", "If set, run benchmarks in this dir. Must also set regtest_bench_file.") -- benchFile = flag.String("didchange_file", "", "The file to modify") -- benchProfile = flag.String("didchange_cpuprof", "", "file to write cpu profiling data to") +- "golang.org/x/tools/gopls/internal/vulncheck" +- "golang.org/x/tools/internal/lsp/source" +- "mvdan.cc/gofumpt/format" +- "mvdan.cc/xurls/v2" -) - --// TestBenchmarkDidChange benchmarks modifications of a single file by making --// synthetic modifications in a comment. It controls pacing by waiting for the --// server to actually start processing the didChange notification before --// proceeding. Notably it does not wait for diagnostics to complete. --// --// Run it by passing -didchange_dir and -didchange_file, where -didchange_dir --// is the path to a workspace root, and -didchange_file is the --// workspace-relative path to a file to modify. e.g.: --// --// go test -run=TestBenchmarkDidChange \ --// -didchange_dir=path/to/kubernetes \ --// -didchange_file=pkg/util/hash/hash.go --func TestBenchmarkDidChange(t *testing.T) { -- if *benchDir == "" { -- t.Skip("-didchange_dir is not set") +-func Options(options *source.Options) { +- options.LicensesText = licensesText +- if options.GoDiff { +- options.ComputeEdits = ComputeEdits - } -- if *benchFile == "" { -- t.Fatal("-didchange_file must be set if -didchange_dir is set") +- options.URLRegexp = xurls.Relaxed() +- options.GofumptFormat = func(ctx context.Context, langVersion, modulePath string, src []byte) ([]byte, error) { +- return format.Source(src, format.Options{ +- LangVersion: langVersion, +- ModulePath: modulePath, +- }) - } +- updateAnalyzers(options) - -- opts := benchmarkOptions(*benchDir) -- WithOptions(opts...).Run(t, "", func(_ *testing.T, env *Env) { -- env.OpenFile(*benchFile) -- env.Await(env.DoneWithOpen()) -- // Insert the text we'll be modifying at the top of the file. -- env.EditBuffer(*benchFile, fake.Edit{Text: "// __REGTEST_PLACEHOLDER_0__\n"}) -- result := testing.Benchmark(func(b *testing.B) { -- if *benchProfile != "" { -- profile, err := os.Create(*benchProfile) -- if err != nil { -- t.Fatal(err) -- } -- defer profile.Close() -- if err := pprof.StartCPUProfile(profile); err != nil { -- t.Fatal(err) -- } -- defer pprof.StopCPUProfile() -- } -- b.ResetTimer() -- for i := 0; i < b.N; i++ { -- env.EditBuffer(*benchFile, fake.Edit{ -- Start: fake.Pos{Line: 0, Column: 0}, -- End: fake.Pos{Line: 1, Column: 0}, -- // Increment -- Text: fmt.Sprintf("// __REGTEST_PLACEHOLDER_%d__\n", i+1), -- }) -- env.Await(StartedChange(uint64(i + 1))) -- } -- b.StopTimer() -- }) -- printBenchmarkResults(result) -- }) +- options.Govulncheck = vulncheck.Govulncheck -} -diff -urN a/gopls/internal/regtest/bench/completion_bench_test.go b/gopls/internal/regtest/bench/completion_bench_test.go ---- a/gopls/internal/regtest/bench/completion_bench_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/bench/completion_bench_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,186 +0,0 @@ +diff -urN a/gopls/internal/hooks/licenses.go b/gopls/internal/hooks/licenses.go +--- a/gopls/internal/hooks/licenses.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/licenses.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,169 +0,0 @@ -// Copyright 2020 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. - --package bench -- --import ( -- "flag" -- "fmt" -- "strings" -- "testing" -- -- . "golang.org/x/tools/internal/lsp/regtest" +-//go:generate ./gen-licenses.sh licenses.go +-package hooks - -- "golang.org/x/tools/internal/lsp/fake" --) +-const licensesText = ` +--- github.com/BurntSushi/toml COPYING -- - --// dummyCompletionFunction to test manually configured completion using CLI. --func dummyCompletionFunction() { const s = "placeholder"; fmt.Printf("%s", s) } +-The MIT License (MIT) - --type completionBenchOptions struct { -- workdir, file, locationRegexp string -- printResults bool -- // hook to run edits before initial completion, not supported for manually -- // configured completions. -- preCompletionEdits func(*Env) --} +-Copyright (c) 2013 TOML authors - --var completionOptions = completionBenchOptions{} +-Permission is hereby granted, free of charge, to any person obtaining a copy +-of this software and associated documentation files (the "Software"), to deal +-in the Software without restriction, including without limitation the rights +-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +-copies of the Software, and to permit persons to whom the Software is +-furnished to do so, subject to the following conditions: - --func init() { -- flag.StringVar(&completionOptions.workdir, "completion_workdir", "", "directory to run completion benchmarks in") -- flag.StringVar(&completionOptions.file, "completion_file", "", "relative path to the file to complete in") -- flag.StringVar(&completionOptions.locationRegexp, "completion_regexp", "", "regexp location to complete at") -- flag.BoolVar(&completionOptions.printResults, "completion_print_results", false, "whether to print completion results") --} +-The above copyright notice and this permission notice shall be included in +-all copies or substantial portions of the Software. - --func benchmarkCompletion(options completionBenchOptions, t *testing.T) { -- if completionOptions.workdir == "" { -- t.Skip("-completion_workdir not configured, skipping benchmark") -- } +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +-THE SOFTWARE. - -- opts := stressTestOptions(options.workdir) +--- github.com/google/go-cmp LICENSE -- - -- // Completion gives bad results if IWL is not yet complete, so we must await -- // it first (and therefore need hooks). -- opts = append(opts, SkipHooks(false)) +-Copyright (c) 2017 The Go Authors. All rights reserved. - -- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) { -- env.OpenFile(options.file) +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: - -- // Run edits required for this completion. -- if options.preCompletionEdits != nil { -- options.preCompletionEdits(env) +- * Redistributions of source code must retain the above copyright +-notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +-copyright notice, this list of conditions and the following disclaimer +-in the documentation and/or other materials provided with the +-distribution. +- * Neither the name of Google Inc. nor the names of its +-contributors may be used to endorse or promote products derived from +-this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- +--- github.com/sergi/go-diff LICENSE -- +- +-Copyright (c) 2012-2016 The go-diff Authors. All rights reserved. +- +-Permission is hereby granted, free of charge, to any person obtaining a +-copy of this software and associated documentation files (the "Software"), +-to deal in the Software without restriction, including without limitation +-the rights to use, copy, modify, merge, publish, distribute, sublicense, +-and/or sell copies of the Software, and to permit persons to whom the +-Software is furnished to do so, subject to the following conditions: +- +-The above copyright notice and this permission notice shall be included +-in all copies or substantial portions of the Software. +- +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +-DEALINGS IN THE SOFTWARE. +- +- +--- honnef.co/go/tools LICENSE -- +- +-Copyright (c) 2016 Dominik Honnef +- +-Permission is hereby granted, free of charge, to any person obtaining +-a copy of this software and associated documentation files (the +-"Software"), to deal in the Software without restriction, including +-without limitation the rights to use, copy, modify, merge, publish, +-distribute, sublicense, and/or sell copies of the Software, and to +-permit persons to whom the Software is furnished to do so, subject to +-the following conditions: +- +-The above copyright notice and this permission notice shall be +-included in all copies or substantial portions of the Software. +- +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- +--- mvdan.cc/gofumpt LICENSE -- +- +-Copyright (c) 2019, Daniel Martí. All rights reserved. +- +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- +- * Redistributions of source code must retain the above copyright +-notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +-copyright notice, this list of conditions and the following disclaimer +-in the documentation and/or other materials provided with the +-distribution. +- * Neither the name of the copyright holder nor the names of its +-contributors may be used to endorse or promote products derived from +-this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- +--- mvdan.cc/xurls/v2 LICENSE -- +- +-Copyright (c) 2015, Daniel Martí. All rights reserved. +- +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- +- * Redistributions of source code must retain the above copyright +-notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +-copyright notice, this list of conditions and the following disclaimer +-in the documentation and/or other materials provided with the +-distribution. +- * Neither the name of the copyright holder nor the names of its +-contributors may be used to endorse or promote products derived from +-this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- +-` +diff -urN a/gopls/internal/hooks/licenses_test.go b/gopls/internal/hooks/licenses_test.go +--- a/gopls/internal/hooks/licenses_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/hooks/licenses_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,46 +0,0 @@ +-// Copyright 2020 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. +- +-package hooks +- +-import ( +- "bytes" +- "io/ioutil" +- "os/exec" +- "runtime" +- "testing" +- +- "golang.org/x/tools/internal/testenv" +-) +- +-func TestLicenses(t *testing.T) { +- // License text differs for older Go versions because staticcheck isn't +- // supported for those versions. +- testenv.NeedsGo1Point(t, 17) +- +- if runtime.GOOS != "linux" && runtime.GOOS != "darwin" { +- t.Skip("generating licenses only works on Unixes") +- } +- tmp, err := ioutil.TempFile("", "") +- if err != nil { +- t.Fatal(err) +- } +- tmp.Close() +- +- if out, err := exec.Command("./gen-licenses.sh", tmp.Name()).CombinedOutput(); err != nil { +- t.Fatalf("generating licenses failed: %q, %v", out, err) +- } +- +- got, err := ioutil.ReadFile(tmp.Name()) +- if err != nil { +- t.Fatal(err) +- } +- want, err := ioutil.ReadFile("licenses.go") +- if err != nil { +- t.Fatal(err) +- } +- if !bytes.Equal(got, want) { +- t.Error("combined license text needs updating. Run: `go generate ./internal/hooks` from the gopls module.") +- } +-} +diff -urN a/gopls/internal/regtest/bench/bench_test.go b/gopls/internal/regtest/bench/bench_test.go +--- a/gopls/internal/regtest/bench/bench_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/bench/bench_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,194 +0,0 @@ +-// Copyright 2020 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. +- +-package bench +- +-import ( +- "flag" +- "fmt" +- "os" +- "runtime/pprof" +- "testing" +- +- "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" +- "golang.org/x/tools/internal/lsp/fake" +- . "golang.org/x/tools/internal/lsp/regtest" +- +- "golang.org/x/tools/internal/lsp/protocol" +-) +- +-func TestMain(m *testing.M) { +- bug.PanicOnBugs = true +- Main(m, hooks.Options) +-} +- +-func benchmarkOptions(dir string) []RunOption { +- return []RunOption{ +- // Run in an existing directory, since we're trying to simulate known cases +- // that cause gopls memory problems. +- InExistingDir(dir), +- // Skip logs as they buffer up memory unnaturally. +- SkipLogs(), +- // The Debug server only makes sense if running in singleton mode. +- Modes(Singleton), +- // Remove the default timeout. Individual tests should control their +- // own graceful termination. +- NoDefaultTimeout(), +- +- // Use the actual proxy, since we want our builds to succeed. +- GOPROXY("https://proxy.golang.org"), +- } +-} +- +-func printBenchmarkResults(result testing.BenchmarkResult) { +- fmt.Printf("BenchmarkStatistics\t%s\t%s\n", result.String(), result.MemString()) +-} +- +-var iwlOptions struct { +- workdir string +-} +- +-func init() { +- flag.StringVar(&iwlOptions.workdir, "iwl_workdir", "", "if set, run IWL benchmark in this directory") +-} +- +-func TestBenchmarkIWL(t *testing.T) { +- if iwlOptions.workdir == "" { +- t.Skip("-iwl_workdir not configured") +- } +- +- opts := stressTestOptions(iwlOptions.workdir) +- // Don't skip hooks, so that we can wait for IWL. +- opts = append(opts, SkipHooks(false)) +- +- results := testing.Benchmark(func(b *testing.B) { +- for i := 0; i < b.N; i++ { +- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) {}) +- } +- }) +- +- printBenchmarkResults(results) +-} +- +-var symbolOptions struct { +- workdir, query, matcher, style string +- printResults bool +-} +- +-func init() { +- flag.StringVar(&symbolOptions.workdir, "symbol_workdir", "", "if set, run symbol benchmark in this directory") +- flag.StringVar(&symbolOptions.query, "symbol_query", "test", "symbol query to use in benchmark") +- flag.StringVar(&symbolOptions.matcher, "symbol_matcher", "", "symbol matcher to use in benchmark") +- flag.StringVar(&symbolOptions.style, "symbol_style", "", "symbol style to use in benchmark") +- flag.BoolVar(&symbolOptions.printResults, "symbol_print_results", false, "whether to print symbol query results") +-} +- +-func TestBenchmarkSymbols(t *testing.T) { +- if symbolOptions.workdir == "" { +- t.Skip("-symbol_workdir not configured") +- } +- +- opts := benchmarkOptions(symbolOptions.workdir) +- conf := EditorConfig{} +- if symbolOptions.matcher != "" { +- conf.SymbolMatcher = &symbolOptions.matcher +- } +- if symbolOptions.style != "" { +- conf.SymbolStyle = &symbolOptions.style +- } +- opts = append(opts, conf) +- +- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) { +- // We can't Await in this test, since we have disabled hooks. Instead, run +- // one symbol request to completion to ensure all necessary cache entries +- // are populated. +- symbols, err := env.Editor.Server.Symbol(env.Ctx, &protocol.WorkspaceSymbolParams{ +- Query: symbolOptions.query, +- }) +- if err != nil { +- t.Fatal(err) +- } +- +- if symbolOptions.printResults { +- fmt.Println("Results:") +- for i := 0; i < len(symbols); i++ { +- fmt.Printf("\t%d. %s (%s)\n", i, symbols[i].Name, symbols[i].ContainerName) +- } +- } +- +- results := testing.Benchmark(func(b *testing.B) { +- for i := 0; i < b.N; i++ { +- if _, err := env.Editor.Server.Symbol(env.Ctx, &protocol.WorkspaceSymbolParams{ +- Query: symbolOptions.query, +- }); err != nil { +- t.Fatal(err) +- } +- } +- }) +- printBenchmarkResults(results) +- }) +-} +- +-var ( +- benchDir = flag.String("didchange_dir", "", "If set, run benchmarks in this dir. Must also set didchange_file.") +- benchFile = flag.String("didchange_file", "", "The file to modify") +- benchProfile = flag.String("didchange_cpuprof", "", "file to write cpu profiling data to") +-) +- +-// TestBenchmarkDidChange benchmarks modifications of a single file by making +-// synthetic modifications in a comment. It controls pacing by waiting for the +-// server to actually start processing the didChange notification before +-// proceeding. Notably it does not wait for diagnostics to complete. +-// +-// Run it by passing -didchange_dir and -didchange_file, where -didchange_dir +-// is the path to a workspace root, and -didchange_file is the +-// workspace-relative path to a file to modify. e.g.: +-// +-// go test -run=TestBenchmarkDidChange \ +-// -didchange_dir=path/to/kubernetes \ +-// -didchange_file=pkg/util/hash/hash.go +-func TestBenchmarkDidChange(t *testing.T) { +- if *benchDir == "" { +- t.Skip("-didchange_dir is not set") +- } +- if *benchFile == "" { +- t.Fatal("-didchange_file must be set if -didchange_dir is set") +- } +- +- opts := benchmarkOptions(*benchDir) +- WithOptions(opts...).Run(t, "", func(_ *testing.T, env *Env) { +- env.OpenFile(*benchFile) +- env.Await(env.DoneWithOpen()) +- // Insert the text we'll be modifying at the top of the file. +- env.EditBuffer(*benchFile, fake.Edit{Text: "// __REGTEST_PLACEHOLDER_0__\n"}) +- +- // Run the profiler after the initial load, +- // across all benchmark iterations. +- if *benchProfile != "" { +- profile, err := os.Create(*benchProfile) +- if err != nil { +- t.Fatal(err) +- } +- defer profile.Close() +- if err := pprof.StartCPUProfile(profile); err != nil { +- t.Fatal(err) +- } +- defer pprof.StopCPUProfile() +- } +- +- result := testing.Benchmark(func(b *testing.B) { +- for i := 0; i < b.N; i++ { +- env.EditBuffer(*benchFile, fake.Edit{ +- Start: fake.Pos{Line: 0, Column: 0}, +- End: fake.Pos{Line: 1, Column: 0}, +- // Increment +- Text: fmt.Sprintf("// __REGTEST_PLACEHOLDER_%d__\n", i+1), +- }) +- env.Await(StartedChange(uint64(i + 1))) +- } +- }) +- printBenchmarkResults(result) +- }) +-} +diff -urN a/gopls/internal/regtest/bench/completion_bench_test.go b/gopls/internal/regtest/bench/completion_bench_test.go +--- a/gopls/internal/regtest/bench/completion_bench_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/bench/completion_bench_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,187 +0,0 @@ +-// Copyright 2020 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. +- +-package bench +- +-import ( +- "flag" +- "fmt" +- "strings" +- "testing" +- +- . "golang.org/x/tools/internal/lsp/regtest" +- +- "golang.org/x/tools/internal/lsp/fake" +-) +- +-// dummyCompletionFunction to test manually configured completion using CLI. +-func dummyCompletionFunction() { const s = "placeholder"; fmt.Printf("%s", s) } +- +-type completionBenchOptions struct { +- workdir, file, locationRegexp string +- printResults bool +- // hook to run edits before initial completion, not supported for manually +- // configured completions. +- preCompletionEdits func(*Env) +-} +- +-var completionOptions = completionBenchOptions{} +- +-func init() { +- flag.StringVar(&completionOptions.workdir, "completion_workdir", "", "directory to run completion benchmarks in") +- flag.StringVar(&completionOptions.file, "completion_file", "", "relative path to the file to complete in") +- flag.StringVar(&completionOptions.locationRegexp, "completion_regexp", "", "regexp location to complete at") +- flag.BoolVar(&completionOptions.printResults, "completion_print_results", false, "whether to print completion results") +-} +- +-func benchmarkCompletion(options completionBenchOptions, t *testing.T) { +- if completionOptions.workdir == "" { +- t.Skip("-completion_workdir not configured, skipping benchmark") +- } +- +- opts := stressTestOptions(options.workdir) +- +- // Completion gives bad results if IWL is not yet complete, so we must await +- // it first (and therefore need hooks). +- opts = append(opts, SkipHooks(false)) +- +- WithOptions(opts...).Run(t, "", func(t *testing.T, env *Env) { +- env.OpenFile(options.file) +- +- // Run edits required for this completion. +- if options.preCompletionEdits != nil { +- options.preCompletionEdits(env) - } - - // Run a completion to make sure the system is warm. @@ -5888,10 +6713,11 @@ diff -urN a/gopls/internal/regtest/bench/completion_bench_test.go b/gopls/intern -// Benchmark completion at a specified file and location. When no CLI options -// are specified, this test is skipped. -// To Run (from x/tools/gopls) against the dummy function above: --// go test -v ./internal/regtest/bench -run=TestBenchmarkConfiguredCompletion --// -completion_workdir="$HOME/Developer/tools" --// -completion_file="gopls/internal/regtest/completion_bench_test.go" --// -completion_regexp="dummyCompletionFunction.*fmt\.Printf\(\"%s\", s(\))" +-// +-// go test -v ./internal/regtest/bench -run=TestBenchmarkConfiguredCompletion +-// -completion_workdir="$HOME/Developer/tools" +-// -completion_file="gopls/internal/regtest/completion_bench_test.go" +-// -completion_regexp="dummyCompletionFunction.*fmt\.Printf\(\"%s\", s(\))" -func TestBenchmarkConfiguredCompletion(t *testing.T) { - benchmarkCompletion(completionOptions, t) -} @@ -5982,8 +6808,8 @@ diff -urN a/gopls/internal/regtest/bench/completion_bench_test.go b/gopls/intern - }, t) -} diff -urN a/gopls/internal/regtest/bench/stress_test.go b/gopls/internal/regtest/bench/stress_test.go ---- a/gopls/internal/regtest/bench/stress_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/bench/stress_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/bench/stress_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/bench/stress_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,66 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -6052,9 +6878,9 @@ diff -urN a/gopls/internal/regtest/bench/stress_test.go b/gopls/internal/regtest - }) -} diff -urN a/gopls/internal/regtest/codelens/codelens_test.go b/gopls/internal/regtest/codelens/codelens_test.go ---- a/gopls/internal/regtest/codelens/codelens_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/codelens/codelens_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,353 +0,0 @@ +--- a/gopls/internal/regtest/codelens/codelens_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/codelens/codelens_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,355 +0,0 @@ -// Copyright 2020 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. @@ -6068,6 +6894,7 @@ diff -urN a/gopls/internal/regtest/codelens/codelens_test.go b/gopls/internal/re - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - . "golang.org/x/tools/internal/lsp/regtest" - - "golang.org/x/tools/internal/lsp/command" @@ -6078,6 +6905,7 @@ diff -urN a/gopls/internal/regtest/codelens/codelens_test.go b/gopls/internal/re -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - @@ -6408,10 +7236,137 @@ diff -urN a/gopls/internal/regtest/codelens/codelens_test.go b/gopls/internal/re - ) - }) -} +diff -urN a/gopls/internal/regtest/completion/completion18_test.go b/gopls/internal/regtest/completion/completion18_test.go +--- a/gopls/internal/regtest/completion/completion18_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/completion/completion18_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,123 +0,0 @@ +-// Copyright 2021 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.18 +-// +build go1.18 +- +-package completion +- +-import ( +- "testing" +- +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-// test generic receivers +-func TestGenericReceiver(t *testing.T) { +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.18 +--- main.go -- +-package main +-type SyncMap[K any, V comparable] struct {} +-func (s *SyncMap[K,V]) f() {} +-type XX[T any] struct {} +-type UU[T any] struct {} +-func (s SyncMap[XX,string]) g(v UU) {} +-` +- +- tests := []struct { +- pat string +- want []string +- }{ +- {"s .Syn", []string{"SyncMap[K, V]"}}, +- {"Map.X", []string{}}, // This is probably wrong, Maybe "XX"? +- {"v U", []string{"UU", "uint", "uint16", "uint32", "uint64", "uint8", "uintptr"}}, // not U[T] +- } +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("main.go") +- env.Await(env.DoneWithOpen()) +- for _, tst := range tests { +- pos := env.RegexpSearch("main.go", tst.pat) +- pos.Column += len(tst.pat) +- completions := env.Completion("main.go", pos) +- result := compareCompletionResults(tst.want, completions.Items) +- if result != "" { +- t.Errorf("%s: wanted %v", result, tst.want) +- for i, g := range completions.Items { +- t.Errorf("got %d %s %s", i, g.Label, g.Detail) +- } +- } +- } +- }) +-} +-func TestFuzzFunc(t *testing.T) { +- // use the example from the package documentation +- modfile := ` +--- go.mod -- +-module mod.com +- +-go 1.18 +-` +- part0 := `package foo +-import "testing" +-func FuzzNone(f *testing.F) { +- f.Add(12) // better not find this f.Add +-} +-func FuzzHex(f *testing.F) { +- for _, seed := range [][]byte{{}, {0}, {9}, {0xa}, {0xf}, {1, 2, 3, 4}} { +- f.Ad` +- part1 := `d(seed) +- } +- f.F` +- part2 := `uzz(func(t *testing.T, in []byte) { +- enc := hex.EncodeToString(in) +- out, err := hex.DecodeString(enc) +- if err != nil { +- f.Failed() +- } +- if !bytes.Equal(in, out) { +- t.Fatalf("%v: round trip: %v, %s", in, out, f.Name()) +- } +- }) +-} +-` +- data := modfile + `-- a_test.go -- +-` + part0 + ` +--- b_test.go -- +-` + part0 + part1 + ` +--- c_test.go -- +-` + part0 + part1 + part2 +- +- tests := []struct { +- file string +- pat string +- offset int // from the beginning of pat to what the user just typed +- want []string +- }{ +- {"a_test.go", "f.Ad", 3, []string{"Add"}}, +- {"c_test.go", " f.F", 4, []string{"Failed"}}, +- {"c_test.go", "f.N", 3, []string{"Name"}}, +- {"b_test.go", "f.F", 3, []string{"Fuzz(func(t *testing.T, a []byte)", "Fail", "FailNow", +- "Failed", "Fatal", "Fatalf"}}, +- } +- Run(t, data, func(t *testing.T, env *Env) { +- for _, test := range tests { +- env.OpenFile(test.file) +- env.Await(env.DoneWithOpen()) +- pos := env.RegexpSearch(test.file, test.pat) +- pos.Column += test.offset // character user just typed? will type? +- completions := env.Completion(test.file, pos) +- result := compareCompletionResults(test.want, completions.Items) +- if result != "" { +- t.Errorf("pat %q %q", test.pat, result) +- for i, it := range completions.Items { +- t.Errorf("%d got %q %q", i, it.Label, it.Detail) +- } +- } +- } +- }) +-} diff -urN a/gopls/internal/regtest/completion/completion_test.go b/gopls/internal/regtest/completion/completion_test.go ---- a/gopls/internal/regtest/completion/completion_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/completion/completion_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,544 +0,0 @@ +--- a/gopls/internal/regtest/completion/completion_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/completion/completion_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,648 +0,0 @@ -// Copyright 2020 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. @@ -6424,6 +7379,7 @@ diff -urN a/gopls/internal/regtest/completion/completion_test.go b/gopls/interna - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - . "golang.org/x/tools/internal/lsp/regtest" - - "golang.org/x/tools/internal/lsp/fake" @@ -6432,6 +7388,7 @@ diff -urN a/gopls/internal/regtest/completion/completion_test.go b/gopls/interna -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - @@ -6662,11 +7619,15 @@ diff -urN a/gopls/internal/regtest/completion/completion_test.go b/gopls/interna - var got []string - for _, item := range gotItems { - got = append(got, item.Label) +- if item.Label != item.InsertText && item.TextEdit == nil { +- // Label should be the same as InsertText, if InsertText is to be used +- return fmt.Sprintf("label not the same as InsertText %#v", item) +- } - } - - for i, v := range got { - if v != want[i] { -- return fmt.Sprintf("completion results are not the same: got %v, want %v", got, want) +- return fmt.Sprintf("%d completion result not the same: got %q, want %q", i, v, want[i]) - } - } - @@ -6956,9 +7917,107 @@ diff -urN a/gopls/internal/regtest/completion/completion_test.go b/gopls/interna - } - }) -} +- +-func TestDefinition(t *testing.T) { +- stuff := ` +--- go.mod -- +-module mod.com +- +-go 1.18 +--- a_test.go -- +-package foo +-func T() +-func TestG() +-func TestM() +-func TestMi() +-func Ben() +-func Fuz() +-func Testx() +-func TestMe(t *testing.T) +-func BenchmarkFoo() +-` +- // All those parentheses are needed for the completion code to see +- // later lines as being definitions +- tests := []struct { +- pat string +- want []string +- }{ +- {"T", []string{"TestXxx(t *testing.T)", "TestMain(m *testing.M)"}}, +- {"TestM", []string{"TestMain(m *testing.M)", "TestM(t *testing.T)"}}, +- {"TestMi", []string{"TestMi(t *testing.T)"}}, +- {"TestG", []string{"TestG(t *testing.T)"}}, +- {"B", []string{"BenchmarkXxx(b *testing.B)"}}, +- {"BenchmarkFoo", []string{"BenchmarkFoo(b *testing.B)"}}, +- {"F", []string{"FuzzXxx(f *testing.F)"}}, +- {"Testx", nil}, +- {"TestMe", []string{"TestMe"}}, +- } +- fname := "a_test.go" +- Run(t, stuff, func(t *testing.T, env *Env) { +- env.OpenFile(fname) +- env.Await(env.DoneWithOpen()) +- for _, tst := range tests { +- pos := env.RegexpSearch(fname, tst.pat) +- pos.Column += len(tst.pat) +- completions := env.Completion(fname, pos) +- result := compareCompletionResults(tst.want, completions.Items) +- if result != "" { +- t.Errorf("%s failed: %s:%q", tst.pat, result, tst.want) +- for i, it := range completions.Items { +- t.Errorf("%d got %q %q", i, it.Label, it.Detail) +- } +- } +- } +- }) +-} +- +-func TestGoWorkCompletion(t *testing.T) { +- const files = ` +--- go.work -- +-go 1.18 +- +-use ./a +-use ./a/ba +-use ./a/b/ +-use ./dir/foo +-use ./dir/foobar/ +--- a/go.mod -- +--- go.mod -- +--- a/bar/go.mod -- +--- a/b/c/d/e/f/go.mod -- +--- dir/bar -- +--- dir/foobar/go.mod -- +-` +- +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("go.work") +- +- tests := []struct { +- re string +- want []string +- }{ +- {`use ()\.`, []string{".", "./a", "./a/bar", "./dir/foobar"}}, +- {`use \.()`, []string{"", "/a", "/a/bar", "/dir/foobar"}}, +- {`use \./()`, []string{"a", "a/bar", "dir/foobar"}}, +- {`use ./a()`, []string{"", "/b/c/d/e/f", "/bar"}}, +- {`use ./a/b()`, []string{"/c/d/e/f", "ar"}}, +- {`use ./a/b/()`, []string{`c/d/e/f`}}, +- {`use ./a/ba()`, []string{"r"}}, +- {`use ./dir/foo()`, []string{"bar"}}, +- {`use ./dir/foobar/()`, []string{}}, +- } +- for _, tt := range tests { +- completions := env.Completion("go.work", env.RegexpSearch("go.work", tt.re)) +- diff := compareCompletionResults(tt.want, completions.Items) +- if diff != "" { +- t.Errorf("%s: %s", tt.re, diff) +- } +- } +- }) +-} diff -urN a/gopls/internal/regtest/completion/postfix_snippet_test.go b/gopls/internal/regtest/completion/postfix_snippet_test.go ---- a/gopls/internal/regtest/completion/postfix_snippet_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/completion/postfix_snippet_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/completion/postfix_snippet_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/completion/postfix_snippet_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,442 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -7402,9 +8461,47 @@ diff -urN a/gopls/internal/regtest/completion/postfix_snippet_test.go b/gopls/in - } - }) -} +diff -urN a/gopls/internal/regtest/debug/debug_test.go b/gopls/internal/regtest/debug/debug_test.go +--- a/gopls/internal/regtest/debug/debug_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/debug/debug_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,34 +0,0 @@ +-// Copyright 2022 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. +- +-package debug +- +-import ( +- "testing" +- +- "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-func TestMain(m *testing.M) { +- Main(m, hooks.Options) +-} +- +-func TestBugNotification(t *testing.T) { +- // Verify that a properly configured session gets notified of a bug on the +- // server. +- WithOptions( +- Modes(Singleton), // must be in-process to receive the bug report below +- EditorConfig{ +- Settings: map[string]interface{}{ +- "showBugReports": true, +- }, +- }, +- ).Run(t, "", func(t *testing.T, env *Env) { +- const desc = "got a bug" +- bug.Report(desc, nil) +- env.Await(ShownMessage(desc)) +- }) +-} diff -urN a/gopls/internal/regtest/diagnostics/builtin_test.go b/gopls/internal/regtest/diagnostics/builtin_test.go ---- a/gopls/internal/regtest/diagnostics/builtin_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/diagnostics/builtin_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/diagnostics/builtin_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/diagnostics/builtin_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -7445,9 +8542,9 @@ diff -urN a/gopls/internal/regtest/diagnostics/builtin_test.go b/gopls/internal/ - }) -} diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/internal/regtest/diagnostics/diagnostics_test.go ---- a/gopls/internal/regtest/diagnostics/diagnostics_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/diagnostics/diagnostics_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,2140 +0,0 @@ +--- a/gopls/internal/regtest/diagnostics/diagnostics_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/diagnostics/diagnostics_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,2268 +0,0 @@ -// Copyright 2020 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. @@ -7461,6 +8558,7 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - . "golang.org/x/tools/internal/lsp/regtest" - - "golang.org/x/tools/internal/lsp" @@ -7470,6 +8568,7 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - @@ -8715,7 +9814,11 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter -` - - WithOptions( -- EditorConfig{EnableStaticcheck: true}, +- EditorConfig{ +- Settings: map[string]interface{}{ +- "staticcheck": true, +- }, +- }, - ).Run(t, files, func(t *testing.T, env *Env) { - env.OpenFile("main.go") - var d protocol.PublishDiagnosticsParams @@ -8963,7 +10066,6 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter -// TestProgressBarErrors confirms that critical workspace load errors are shown -// and updated via progress reports. -func TestProgressBarErrors(t *testing.T) { -- t.Skip("too flaky: golang/go#46930") - testenv.NeedsGo1Point(t, 14) - - const pkg = ` @@ -9096,7 +10198,19 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter - Run(t, mod, func(t *testing.T, env *Env) { - env.OpenFile("a/a.go") - env.OpenFile("b/b.go") -- env.Await(env.DiagnosticAtRegexp("a/a.go", `"mod.test/b"`)) +- env.Await( +- OnceMet( +- env.DoneWithOpen(), +- // The Go command sometimes tells us about only one of the import cycle +- // errors below. For robustness of this test, succeed if we get either. +- // +- // TODO(golang/go#52904): we should get *both* of these errors. +- AnyOf( +- env.DiagnosticAtRegexpWithMessage("a/a.go", `"mod.test/b"`, "import cycle"), +- env.DiagnosticAtRegexpWithMessage("b/b.go", `"mod.test/a"`, "import cycle"), +- ), +- ), +- ) - env.RegexpReplace("b/b.go", `const B = a\.B`, "") - env.SaveBuffer("b/b.go") - env.Await( @@ -9581,16 +10695,127 @@ diff -urN a/gopls/internal/regtest/diagnostics/diagnostics_test.go b/gopls/inter -`)) - env.Await( - OnceMet( -- env.DoneWithChange(), -- env.DiagnosticAtRegexp("main.go", `"fmt"`), -- CompletedWork("Load", 3, false), +- env.DoneWithChange(), +- env.DiagnosticAtRegexp("main.go", `"fmt"`), +- CompletedWork("Load", 3, false), +- ), +- ) +- }) +-} +- +-func TestLangVersion(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) // Requires types.Config.GoVersion, new in 1.18. +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- main.go -- +-package main +- +-const C = 0b10 +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.Await(env.DiagnosticAtRegexpWithMessage("main.go", `0b10`, "go1.13 or later")) +- env.WriteWorkspaceFile("go.mod", "module mod.com \n\ngo 1.13\n") +- env.Await(EmptyDiagnostics("main.go")) +- }) +-} +- +-func TestNoQuickFixForUndeclaredConstraint(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.18 +--- main.go -- +-package main +- +-func F[T C](_ T) { +-} +-` +- +- Run(t, files, func(t *testing.T, env *Env) { +- var d protocol.PublishDiagnosticsParams +- env.Await( +- OnceMet( +- env.DiagnosticAtRegexpWithMessage("main.go", `C`, "undeclared name"), +- ReadDiagnostics("main.go", &d), +- ), +- ) +- if fixes := env.GetQuickFixes("main.go", d.Diagnostics); len(fixes) != 0 { +- t.Errorf("got quick fixes %v, wanted none", fixes) +- } +- }) +-} +- +-func TestEditGoDirective(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.16 +--- main.go -- +-package main +- +-func F[T any](_ T) { +-} +-` +- Run(t, files, func(_ *testing.T, env *Env) { // Create a new workspace-level directory and empty file. +- var d protocol.PublishDiagnosticsParams +- env.Await( +- OnceMet( +- env.DiagnosticAtRegexpWithMessage("main.go", `T any`, "type parameters require"), +- ReadDiagnostics("main.go", &d), +- ), +- ) +- +- env.ApplyQuickFixes("main.go", d.Diagnostics) +- +- env.Await( +- EmptyDiagnostics("main.go"), +- ) +- }) +-} +- +-func TestEditGoDirectiveWorkspace(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.16 +--- go.work -- +-go 1.18 +- +-use . +--- main.go -- +-package main +- +-func F[T any](_ T) { +-} +-` +- Run(t, files, func(_ *testing.T, env *Env) { // Create a new workspace-level directory and empty file. +- var d protocol.PublishDiagnosticsParams +- env.Await( +- OnceMet( +- env.DiagnosticAtRegexpWithMessage("main.go", `T any`, "type parameters require"), +- ReadDiagnostics("main.go", &d), - ), - ) +- +- env.ApplyQuickFixes("main.go", d.Diagnostics) +- +- env.Await( +- EmptyDiagnostics("main.go"), +- ) - }) -} diff -urN a/gopls/internal/regtest/diagnostics/undeclared_test.go b/gopls/internal/regtest/diagnostics/undeclared_test.go ---- a/gopls/internal/regtest/diagnostics/undeclared_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/diagnostics/undeclared_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/diagnostics/undeclared_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/diagnostics/undeclared_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -9659,72 +10884,9 @@ diff -urN a/gopls/internal/regtest/diagnostics/undeclared_test.go b/gopls/intern - } - }) -} -diff -urN a/gopls/internal/regtest/misc/add_import_test.go b/gopls/internal/regtest/misc/add_import_test.go ---- a/gopls/internal/regtest/misc/add_import_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/add_import_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,59 +0,0 @@ --// Copyright 2021 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. -- --package misc -- --import ( -- "testing" -- -- "golang.org/x/tools/internal/lsp/command" -- "golang.org/x/tools/internal/lsp/protocol" -- . "golang.org/x/tools/internal/lsp/regtest" -- "golang.org/x/tools/internal/lsp/tests" --) -- --func TestAddImport(t *testing.T) { -- const before = `package main -- --import "fmt" -- --func main() { -- fmt.Println("hello world") --} --` -- -- const want = `package main -- --import ( -- "bytes" -- "fmt" --) -- --func main() { -- fmt.Println("hello world") --} --` -- -- Run(t, "", func(t *testing.T, env *Env) { -- env.CreateBuffer("main.go", before) -- cmd, err := command.NewAddImportCommand("Add Import", command.AddImportArgs{ -- URI: protocol.URIFromSpanURI(env.Sandbox.Workdir.URI("main.go").SpanURI()), -- ImportPath: "bytes", -- }) -- if err != nil { -- t.Fatal(err) -- } -- _, err = env.Editor.ExecuteCommand(env.Ctx, &protocol.ExecuteCommandParams{ -- Command: "gopls.add_import", -- Arguments: cmd.Arguments, -- }) -- if err != nil { -- t.Fatal(err) -- } -- got := env.Editor.BufferText("main.go") -- if got != want { -- t.Fatalf("gopls.add_import failed\n%s", tests.Diff(t, want, got)) -- } -- }) --} diff -urN a/gopls/internal/regtest/misc/call_hierarchy_test.go b/gopls/internal/regtest/misc/call_hierarchy_test.go ---- a/gopls/internal/regtest/misc/call_hierarchy_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/call_hierarchy_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/call_hierarchy_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/call_hierarchy_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,35 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -9762,9 +10924,9 @@ diff -urN a/gopls/internal/regtest/misc/call_hierarchy_test.go b/gopls/internal/ - }) -} diff -urN a/gopls/internal/regtest/misc/configuration_test.go b/gopls/internal/regtest/misc/configuration_test.go ---- a/gopls/internal/regtest/misc/configuration_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/configuration_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,49 +0,0 @@ +--- a/gopls/internal/regtest/misc/configuration_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/configuration_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,80 +0,0 @@ -// Copyright 2020 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. @@ -9783,8 +10945,10 @@ diff -urN a/gopls/internal/regtest/misc/configuration_test.go b/gopls/internal/r -// Test that enabling and disabling produces the expected results of showing -// and hiding staticcheck analysis results. -func TestChangeConfiguration(t *testing.T) { -- // Staticcheck only supports Go versions > 1.14. -- testenv.NeedsGo1Point(t, 15) +- // Staticcheck only supports Go versions >= 1.17. +- // Note: keep this in sync with TestStaticcheckWarning. Below this version we +- // should get an error when setting staticcheck configuration. +- testenv.NeedsGo1Point(t, 17) - - const files = ` --- go.mod -- @@ -9807,16 +10971,45 @@ diff -urN a/gopls/internal/regtest/misc/configuration_test.go b/gopls/internal/r - ) - cfg := &fake.EditorConfig{} - *cfg = env.Editor.Config -- cfg.EnableStaticcheck = true +- cfg.Settings = map[string]interface{}{ +- "staticcheck": true, +- } - env.ChangeConfiguration(t, cfg) - env.Await( - DiagnosticAt("a/a.go", 5, 4), - ) - }) -} +- +-func TestStaticcheckWarning(t *testing.T) { +- // Note: keep this in sync with TestChangeConfiguration. +- testenv.SkipAfterGo1Point(t, 16) +- +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- a/a.go -- +-package a +- +-import "errors" +- +-// FooErr should be called ErrFoo (ST1012) +-var FooErr = errors.New("foo") +-` +- +- WithOptions(EditorConfig{ +- Settings: map[string]interface{}{ +- "staticcheck": true, +- }, +- }).Run(t, files, func(t *testing.T, env *Env) { +- env.Await(ShownMessage("staticcheck is not supported")) +- }) +-} diff -urN a/gopls/internal/regtest/misc/debugserver_test.go b/gopls/internal/regtest/misc/debugserver_test.go ---- a/gopls/internal/regtest/misc/debugserver_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/debugserver_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/debugserver_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/debugserver_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -9865,8 +11058,8 @@ diff -urN a/gopls/internal/regtest/misc/debugserver_test.go b/gopls/internal/reg - }) -} diff -urN a/gopls/internal/regtest/misc/definition_test.go b/gopls/internal/regtest/misc/definition_test.go ---- a/gopls/internal/regtest/misc/definition_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/definition_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/definition_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/definition_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,291 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10160,8 +11353,8 @@ diff -urN a/gopls/internal/regtest/misc/definition_test.go b/gopls/internal/regt - }) -} diff -urN a/gopls/internal/regtest/misc/embed_test.go b/gopls/internal/regtest/misc/embed_test.go ---- a/gopls/internal/regtest/misc/embed_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/embed_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/embed_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/embed_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10201,8 +11394,8 @@ diff -urN a/gopls/internal/regtest/misc/embed_test.go b/gopls/internal/regtest/m - }) -} diff -urN a/gopls/internal/regtest/misc/failures_test.go b/gopls/internal/regtest/misc/failures_test.go ---- a/gopls/internal/regtest/misc/failures_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/failures_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/failures_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/failures_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,70 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10275,8 +11468,8 @@ diff -urN a/gopls/internal/regtest/misc/failures_test.go b/gopls/internal/regtes - }) -} diff -urN a/gopls/internal/regtest/misc/fix_test.go b/gopls/internal/regtest/misc/fix_test.go ---- a/gopls/internal/regtest/misc/fix_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/fix_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/fix_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/fix_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,107 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10386,9 +11579,9 @@ diff -urN a/gopls/internal/regtest/misc/fix_test.go b/gopls/internal/regtest/mis - }) -} diff -urN a/gopls/internal/regtest/misc/formatting_test.go b/gopls/internal/regtest/misc/formatting_test.go ---- a/gopls/internal/regtest/misc/formatting_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/formatting_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,303 +0,0 @@ +--- a/gopls/internal/regtest/misc/formatting_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/formatting_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,369 +0,0 @@ -// Copyright 2020 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. @@ -10692,9 +11885,75 @@ diff -urN a/gopls/internal/regtest/misc/formatting_test.go b/gopls/internal/regt - } - }) -} +- +-func TestGofumptFormatting(t *testing.T) { +- +- // Exercise some gofumpt formatting rules: +- // - No empty lines following an assignment operator +- // - Octal integer literals should use the 0o prefix on modules using Go +- // 1.13 and later. Requires LangVersion to be correctly resolved. +- // - std imports must be in a separate group at the top. Requires ModulePath +- // to be correctly resolved. +- const input = ` +--- go.mod -- +-module foo +- +-go 1.17 +--- foo.go -- +-package foo +- +-import ( +- "foo/bar" +- "fmt" +-) +- +-const perm = 0755 +- +-func foo() { +- foo := +- "bar" +- fmt.Println(foo, bar.Bar) +-} +--- foo.go.formatted -- +-package foo +- +-import ( +- "fmt" +- +- "foo/bar" +-) +- +-const perm = 0o755 +- +-func foo() { +- foo := "bar" +- fmt.Println(foo, bar.Bar) +-} +--- bar/bar.go -- +-package bar +- +-const Bar = 42 +-` +- +- WithOptions( +- EditorConfig{ +- Settings: map[string]interface{}{ +- "gofumpt": true, +- }, +- }, +- ).Run(t, input, func(t *testing.T, env *Env) { +- env.OpenFile("foo.go") +- env.FormatBuffer("foo.go") +- got := env.Editor.BufferText("foo.go") +- want := env.ReadWorkspaceFile("foo.go.formatted") +- if got != want { +- t.Errorf("unexpected formatting result:\n%s", tests.Diff(t, want, got)) +- } +- }) +-} diff -urN a/gopls/internal/regtest/misc/generate_test.go b/gopls/internal/regtest/misc/generate_test.go ---- a/gopls/internal/regtest/misc/generate_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/generate_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/generate_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/generate_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,75 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10772,8 +12031,8 @@ diff -urN a/gopls/internal/regtest/misc/generate_test.go b/gopls/internal/regtes - }) -} diff -urN a/gopls/internal/regtest/misc/highlight_test.go b/gopls/internal/regtest/misc/highlight_test.go ---- a/gopls/internal/regtest/misc/highlight_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/highlight_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/highlight_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/highlight_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,151 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -10927,9 +12186,9 @@ diff -urN a/gopls/internal/regtest/misc/highlight_test.go b/gopls/internal/regte - } -} diff -urN a/gopls/internal/regtest/misc/hover_test.go b/gopls/internal/regtest/misc/hover_test.go ---- a/gopls/internal/regtest/misc/hover_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/hover_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,132 +0,0 @@ +--- a/gopls/internal/regtest/misc/hover_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/hover_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,223 +0,0 @@ -// Copyright 2021 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. @@ -10937,6 +12196,7 @@ diff -urN a/gopls/internal/regtest/misc/hover_test.go b/gopls/internal/regtest/m -package misc - -import ( +- "fmt" - "strings" - "testing" - @@ -10956,6 +12216,7 @@ diff -urN a/gopls/internal/regtest/misc/hover_test.go b/gopls/internal/regtest/m -package structs - -type Mixed struct { +- // Exported comment - Exported int - unexported string -} @@ -10968,103 +12229,329 @@ diff -urN a/gopls/internal/regtest/misc/hover_test.go b/gopls/internal/regtest/m --- go.mod -- -module mod.com - --go 1.12 +-go 1.12 +- +-require golang.org/x/structs v1.0.0 +--- go.sum -- +-golang.org/x/structs v1.0.0 h1:Ito/a7hBYZaNKShFrZKjfBA/SIPvmBrcPCBWPx5QeKk= +-golang.org/x/structs v1.0.0/go.mod h1:47gkSIdo5AaQaWJS0upVORsxfEr1LL1MWv9dmYF3iq4= +--- main.go -- +-package main +- +-import "golang.org/x/structs" +- +-func main() { +- var m structs.Mixed +- _ = m.Exported +-} +-` +- +- // TODO: use a nested workspace folder here. +- WithOptions( +- ProxyFiles(proxy), +- ).Run(t, mod, func(t *testing.T, env *Env) { +- env.OpenFile("main.go") +- mixedPos := env.RegexpSearch("main.go", "Mixed") +- got, _ := env.Hover("main.go", mixedPos) +- if !strings.Contains(got.Value, "unexported") { +- t.Errorf("Workspace hover: missing expected field 'unexported'. Got:\n%q", got.Value) +- } +- +- cacheFile, _ := env.GoToDefinition("main.go", mixedPos) +- argPos := env.RegexpSearch(cacheFile, "printMixed.*(Mixed)") +- got, _ = env.Hover(cacheFile, argPos) +- if !strings.Contains(got.Value, "unexported") { +- t.Errorf("Non-workspace hover: missing expected field 'unexported'. Got:\n%q", got.Value) +- } +- +- exportedFieldPos := env.RegexpSearch("main.go", "Exported") +- got, _ = env.Hover("main.go", exportedFieldPos) +- if !strings.Contains(got.Value, "comment") { +- t.Errorf("Workspace hover: missing comment for field 'Exported'. Got:\n%q", got.Value) +- } +- }) +-} +- +-func TestHoverIntLiteral(t *testing.T) { +- testenv.NeedsGo1Point(t, 13) +- const source = ` +--- main.go -- +-package main +- +-var ( +- bigBin = 0b1001001 +-) +- +-var hex = 0xe34e +- +-func main() { +-} +-` +- Run(t, source, func(t *testing.T, env *Env) { +- env.OpenFile("main.go") +- hexExpected := "58190" +- got, _ := env.Hover("main.go", env.RegexpSearch("main.go", "hex")) +- if got != nil && !strings.Contains(got.Value, hexExpected) { +- t.Errorf("Hover: missing expected field '%s'. Got:\n%q", hexExpected, got.Value) +- } +- +- binExpected := "73" +- got, _ = env.Hover("main.go", env.RegexpSearch("main.go", "bigBin")) +- if got != nil && !strings.Contains(got.Value, binExpected) { +- t.Errorf("Hover: missing expected field '%s'. Got:\n%q", binExpected, got.Value) +- } +- }) +-} +- +-// Tests that hovering does not trigger the panic in golang/go#48249. +-func TestPanicInHoverBrokenCode(t *testing.T) { +- testenv.NeedsGo1Point(t, 13) +- const source = ` +--- main.go -- +-package main +- +-type Example struct` +- Run(t, source, func(t *testing.T, env *Env) { +- env.OpenFile("main.go") +- env.Editor.Hover(env.Ctx, "main.go", env.RegexpSearch("main.go", "Example")) +- }) +-} +- +-func TestHoverRune_48492(t *testing.T) { +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.18 +--- main.go -- +-package main +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("main.go") +- env.EditBuffer("main.go", fake.NewEdit(0, 0, 1, 0, "package main\nfunc main() {\nconst x = `\nfoo\n`\n}")) +- env.Editor.Hover(env.Ctx, "main.go", env.RegexpSearch("main.go", "foo")) +- }) +-} +- +-func TestHoverImport(t *testing.T) { +- // For Go.13 and earlier versions, Go will try to download imported but missing packages. This behavior breaks the +- // workspace as Go fails to download non-existent package "mod.com/lib4" +- testenv.NeedsGo1Point(t, 14) +- const packageDoc1 = "Package lib1 hover documentation" +- const packageDoc2 = "Package lib2 hover documentation" +- tests := []struct { +- hoverPackage string +- want string +- }{ +- { +- "mod.com/lib1", +- packageDoc1, +- }, +- { +- "mod.com/lib2", +- packageDoc2, +- }, +- { +- "mod.com/lib3", +- "", +- }, +- } +- source := fmt.Sprintf(` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- lib1/a.go -- +-// %s +-package lib1 +- +-const C = 1 +- +--- lib1/b.go -- +-package lib1 +- +-const D = 1 +- +--- lib2/a.go -- +-// %s +-package lib2 +- +-const E = 1 +- +--- lib3/a.go -- +-package lib3 +- +-const F = 1 - --require golang.org/x/structs v1.0.0 ---- go.sum -- --golang.org/x/structs v1.0.0 h1:3DlrFfd3OsEen7FnCHfqtnJvjBZ8ZFKmrD/+HjpdJj0= --golang.org/x/structs v1.0.0/go.mod h1:47gkSIdo5AaQaWJS0upVORsxfEr1LL1MWv9dmYF3iq4= --- main.go -- -package main - --import "golang.org/x/structs" +-import ( +- "mod.com/lib1" +- "mod.com/lib2" +- "mod.com/lib3" +- "mod.com/lib4" +-) - -func main() { -- var _ structs.Mixed +- println("Hello") -} --` -- // TODO: use a nested workspace folder here. -- WithOptions( -- ProxyFiles(proxy), -- ).Run(t, mod, func(t *testing.T, env *Env) { +- `, packageDoc1, packageDoc2) +- Run(t, source, func(t *testing.T, env *Env) { - env.OpenFile("main.go") -- mixedPos := env.RegexpSearch("main.go", "Mixed") -- got, _ := env.Hover("main.go", mixedPos) -- if !strings.Contains(got.Value, "unexported") { -- t.Errorf("Workspace hover: missing expected field 'unexported'. Got:\n%q", got.Value) +- for _, test := range tests { +- got, _ := env.Hover("main.go", env.RegexpSearch("main.go", test.hoverPackage)) +- if !strings.Contains(got.Value, test.want) { +- t.Errorf("Hover: got:\n%q\nwant:\n%q", got.Value, test.want) +- } - } -- cacheFile, _ := env.GoToDefinition("main.go", mixedPos) -- argPos := env.RegexpSearch(cacheFile, "printMixed.*(Mixed)") -- got, _ = env.Hover(cacheFile, argPos) -- if !strings.Contains(got.Value, "unexported") { -- t.Errorf("Non-workspace hover: missing expected field 'unexported'. Got:\n%q", got.Value) +- +- got, _ := env.Hover("main.go", env.RegexpSearch("main.go", "mod.com/lib4")) +- if got != nil { +- t.Errorf("Hover: got:\n%q\nwant:\n%v", got.Value, nil) - } - }) -} +diff -urN a/gopls/internal/regtest/misc/import_test.go b/gopls/internal/regtest/misc/import_test.go +--- a/gopls/internal/regtest/misc/import_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/import_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,133 +0,0 @@ +-// Copyright 2021 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. - --func TestHoverIntLiteral(t *testing.T) { -- testenv.NeedsGo1Point(t, 13) -- const source = ` ---- main.go -- --package main +-package misc - --var ( -- bigBin = 0b1001001 +-import ( +- "testing" +- +- "github.com/google/go-cmp/cmp" +- "golang.org/x/tools/internal/lsp/command" +- "golang.org/x/tools/internal/lsp/protocol" +- . "golang.org/x/tools/internal/lsp/regtest" +- "golang.org/x/tools/internal/lsp/tests" -) - --var hex = 0xe34e +-func TestAddImport(t *testing.T) { +- const before = `package main +- +-import "fmt" - -func main() { +- fmt.Println("hello world") -} -` -- Run(t, source, func(t *testing.T, env *Env) { -- env.OpenFile("main.go") -- hexExpected := "58190" -- got, _ := env.Hover("main.go", env.RegexpSearch("main.go", "hex")) -- if got != nil && !strings.Contains(got.Value, hexExpected) { -- t.Errorf("Hover: missing expected field '%s'. Got:\n%q", hexExpected, got.Value) -- } - -- binExpected := "73" -- got, _ = env.Hover("main.go", env.RegexpSearch("main.go", "bigBin")) -- if got != nil && !strings.Contains(got.Value, binExpected) { -- t.Errorf("Hover: missing expected field '%s'. Got:\n%q", binExpected, got.Value) -- } -- }) --} +- const want = `package main - --// Tests that hovering does not trigger the panic in golang/go#48249. --func TestPanicInHoverBrokenCode(t *testing.T) { -- testenv.NeedsGo1Point(t, 13) -- const source = ` ---- main.go -- --package main +-import ( +- "bytes" +- "fmt" +-) - --type Example struct` -- Run(t, source, func(t *testing.T, env *Env) { -- env.OpenFile("main.go") -- env.Editor.Hover(env.Ctx, "main.go", env.RegexpSearch("main.go", "Example")) +-func main() { +- fmt.Println("hello world") +-} +-` +- +- Run(t, "", func(t *testing.T, env *Env) { +- env.CreateBuffer("main.go", before) +- cmd, err := command.NewAddImportCommand("Add Import", command.AddImportArgs{ +- URI: env.Sandbox.Workdir.URI("main.go"), +- ImportPath: "bytes", +- }) +- if err != nil { +- t.Fatal(err) +- } +- env.ExecuteCommand(&protocol.ExecuteCommandParams{ +- Command: "gopls.add_import", +- Arguments: cmd.Arguments, +- }, nil) +- got := env.Editor.BufferText("main.go") +- if got != want { +- t.Fatalf("gopls.add_import failed\n%s", tests.Diff(t, want, got)) +- } - }) -} - --func TestHoverRune_48492(t *testing.T) { +-func TestListImports(t *testing.T) { - const files = ` --- go.mod -- -module mod.com - --go 1.18 ---- main.go -- --package main +-go 1.12 +--- foo.go -- +-package foo +-const C = 1 +--- import_strings_test.go -- +-package foo +-import ( +- x "strings" +- "testing" +-) +- +-func TestFoo(t *testing.T) {} +--- import_testing_test.go -- +-package foo +- +-import "testing" +- +-func TestFoo2(t *testing.T) {} -` +- tests := []struct { +- filename string +- want command.ListImportsResult +- }{ +- { +- filename: "import_strings_test.go", +- want: command.ListImportsResult{ +- Imports: []command.FileImport{ +- {Name: "x", Path: "strings"}, +- {Path: "testing"}, +- }, +- PackageImports: []command.PackageImport{ +- {Path: "strings"}, +- {Path: "testing"}, +- }, +- }, +- }, +- { +- filename: "import_testing_test.go", +- want: command.ListImportsResult{ +- Imports: []command.FileImport{ +- {Path: "testing"}, +- }, +- PackageImports: []command.PackageImport{ +- {Path: "strings"}, +- {Path: "testing"}, +- }, +- }, +- }, +- } +- - Run(t, files, func(t *testing.T, env *Env) { -- env.OpenFile("main.go") -- env.EditBuffer("main.go", fake.NewEdit(0, 0, 1, 0, "package main\nfunc main() {\nconst x = `\nfoo\n`\n}")) -- env.Editor.Hover(env.Ctx, "main.go", env.RegexpSearch("main.go", "foo")) +- for _, tt := range tests { +- cmd, err := command.NewListImportsCommand("List Imports", command.URIArg{ +- URI: env.Sandbox.Workdir.URI(tt.filename), +- }) +- if err != nil { +- t.Fatal(err) +- } +- var result command.ListImportsResult +- env.ExecuteCommand(&protocol.ExecuteCommandParams{ +- Command: command.ListImports.ID(), +- Arguments: cmd.Arguments, +- }, &result) +- if diff := cmp.Diff(tt.want, result); diff != "" { +- t.Errorf("unexpected list imports result for %q (-want +got):\n%s", tt.filename, diff) +- } +- } +- - }) -} diff -urN a/gopls/internal/regtest/misc/imports_test.go b/gopls/internal/regtest/misc/imports_test.go ---- a/gopls/internal/regtest/misc/imports_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/imports_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/imports_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/imports_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,216 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11283,9 +12770,9 @@ diff -urN a/gopls/internal/regtest/misc/imports_test.go b/gopls/internal/regtest - }) -} diff -urN a/gopls/internal/regtest/misc/link_test.go b/gopls/internal/regtest/misc/link_test.go ---- a/gopls/internal/regtest/misc/link_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/link_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,95 +0,0 @@ +--- a/gopls/internal/regtest/misc/link_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/link_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,98 +0,0 @@ -// Copyright 2020 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. @@ -11303,6 +12790,7 @@ diff -urN a/gopls/internal/regtest/misc/link_test.go b/gopls/internal/regtest/mi - -func TestHoverAndDocumentLink(t *testing.T) { - testenv.NeedsGo1Point(t, 13) +- - const program = ` --- go.mod -- -module mod.test @@ -11319,6 +12807,8 @@ diff -urN a/gopls/internal/regtest/misc/link_test.go b/gopls/internal/regtest/mi -import "import.test/pkg" - -func main() { +- // Issue 43990: this is not a link that most users can open from an LSP +- // client: mongodb://not.a.link.com - println(pkg.Hello) -}` - @@ -11382,9 +12872,9 @@ diff -urN a/gopls/internal/regtest/misc/link_test.go b/gopls/internal/regtest/mi - }) -} diff -urN a/gopls/internal/regtest/misc/misc_test.go b/gopls/internal/regtest/misc/misc_test.go ---- a/gopls/internal/regtest/misc/misc_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/misc_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,16 +0,0 @@ +--- a/gopls/internal/regtest/misc/misc_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/misc_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,18 +0,0 @@ -// Copyright 2020 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. @@ -11395,15 +12885,17 @@ diff -urN a/gopls/internal/regtest/misc/misc_test.go b/gopls/internal/regtest/mi - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - "golang.org/x/tools/internal/lsp/regtest" -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - regtest.Main(m, hooks.Options) -} diff -urN a/gopls/internal/regtest/misc/multiple_adhoc_test.go b/gopls/internal/regtest/misc/multiple_adhoc_test.go ---- a/gopls/internal/regtest/misc/multiple_adhoc_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/multiple_adhoc_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/multiple_adhoc_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/multiple_adhoc_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11450,8 +12942,8 @@ diff -urN a/gopls/internal/regtest/misc/multiple_adhoc_test.go b/gopls/internal/ - }) -} diff -urN a/gopls/internal/regtest/misc/references_test.go b/gopls/internal/regtest/misc/references_test.go ---- a/gopls/internal/regtest/misc/references_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/references_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/references_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/references_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,83 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11537,8 +13029,8 @@ diff -urN a/gopls/internal/regtest/misc/references_test.go b/gopls/internal/regt - }) -} diff -urN a/gopls/internal/regtest/misc/rename_test.go b/gopls/internal/regtest/misc/rename_test.go ---- a/gopls/internal/regtest/misc/rename_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/rename_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/rename_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/rename_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,58 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11599,8 +13091,8 @@ diff -urN a/gopls/internal/regtest/misc/rename_test.go b/gopls/internal/regtest/ - }) -} diff -urN a/gopls/internal/regtest/misc/semantictokens_test.go b/gopls/internal/regtest/misc/semantictokens_test.go ---- a/gopls/internal/regtest/misc/semantictokens_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/semantictokens_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/semantictokens_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/semantictokens_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11646,9 +13138,49 @@ diff -urN a/gopls/internal/regtest/misc/semantictokens_test.go b/gopls/internal/ - } - }) -} +diff -urN a/gopls/internal/regtest/misc/settings_test.go b/gopls/internal/regtest/misc/settings_test.go +--- a/gopls/internal/regtest/misc/settings_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/settings_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,36 +0,0 @@ +-// Copyright 2022 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. +- +-package misc +- +-import ( +- "testing" +- +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-func TestEmptyDirectoryFilters_Issue51843(t *testing.T) { +- const src = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- main.go -- +-package main +- +-func main() { +-} +-` +- +- WithOptions( +- EditorConfig{ +- Settings: map[string]interface{}{ +- "directoryFilters": []string{""}, +- }, +- }, +- ).Run(t, src, func(t *testing.T, env *Env) { +- // No need to do anything. Issue golang/go#51843 is triggered by the empty +- // directory filter above. +- }) +-} diff -urN a/gopls/internal/regtest/misc/shared_test.go b/gopls/internal/regtest/misc/shared_test.go ---- a/gopls/internal/regtest/misc/shared_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/shared_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/shared_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/shared_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,64 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11714,10 +13246,92 @@ diff -urN a/gopls/internal/regtest/misc/shared_test.go b/gopls/internal/regtest/ - env2.Await(env2.DiagnosticAtRegexp("main.go", "$")) - }) -} +diff -urN a/gopls/internal/regtest/misc/staticcheck_test.go b/gopls/internal/regtest/misc/staticcheck_test.go +--- a/gopls/internal/regtest/misc/staticcheck_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/staticcheck_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,78 +0,0 @@ +-// Copyright 2022 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. +- +-package misc +- +-import ( +- "testing" +- +- "golang.org/x/tools/internal/testenv" +- +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-func TestStaticcheckGenerics(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) // generics were introduced in Go 1.18 +- +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.18 +--- a/a.go -- +-package a +- +-import ( +- "errors" +- "sort" +- "strings" +-) +- +-func Zero[P any]() P { +- var p P +- return p +-} +- +-type Inst[P any] struct { +- Field P +-} +- +-func testGenerics[P *T, T any](p P) { +- // Calls to instantiated functions should not break checks. +- slice := Zero[string]() +- sort.Slice(slice, func(i, j int) bool { +- return slice[i] < slice[j] +- }) +- +- // Usage of instantiated fields should not break checks. +- g := Inst[string]{"hello"} +- g.Field = strings.TrimLeft(g.Field, "12234") +- +- // Use of type parameters should not break checks. +- var q P +- p = q // SA4009: p is overwritten before its first use +- q = &*p // SA4001: &* will be simplified +-} +- +- +-// FooErr should be called ErrFoo (ST1012) +-var FooErr error = errors.New("foo") +-` +- +- WithOptions(EditorConfig{ +- Settings: map[string]interface{}{ +- "staticcheck": true, +- }, +- }).Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("a/a.go") +- env.Await( +- env.DiagnosticAtRegexpFromSource("a/a.go", "sort.Slice", "sortslice"), +- env.DiagnosticAtRegexpFromSource("a/a.go", "sort.Slice.(slice)", "SA1028"), +- env.DiagnosticAtRegexpFromSource("a/a.go", "var (FooErr)", "ST1012"), +- env.DiagnosticAtRegexpFromSource("a/a.go", `"12234"`, "SA1024"), +- env.DiagnosticAtRegexpFromSource("a/a.go", "testGenerics.*(p P)", "SA4009"), +- env.DiagnosticAtRegexpFromSource("a/a.go", "q = (&\\*p)", "SA4001"), +- ) +- }) +-} diff -urN a/gopls/internal/regtest/misc/vendor_test.go b/gopls/internal/regtest/misc/vendor_test.go ---- a/gopls/internal/regtest/misc/vendor_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/vendor_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,73 +0,0 @@ +--- a/gopls/internal/regtest/misc/vendor_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/vendor_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,79 +0,0 @@ -// Copyright 2020 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. @@ -11725,7 +13339,6 @@ diff -urN a/gopls/internal/regtest/misc/vendor_test.go b/gopls/internal/regtest/ -package misc - -import ( -- "runtime" - "testing" - - . "golang.org/x/tools/internal/lsp/regtest" @@ -11747,9 +13360,16 @@ diff -urN a/gopls/internal/regtest/misc/vendor_test.go b/gopls/internal/regtest/ - -func TestInconsistentVendoring(t *testing.T) { - testenv.NeedsGo1Point(t, 14) -- if runtime.GOOS == "windows" { -- t.Skipf("skipping test due to flakiness on Windows: https://golang.org/issue/49646") -- } +- +- // TODO(golang/go#49646): delete this comment once this test is stable. +- // +- // In golang/go#49646, this test is reported as flaky on Windows. We believe +- // this is due to file contention from go mod vendor that should be resolved. +- // If this test proves to still be flaky, skip it. +- // +- // if runtime.GOOS == "windows" { +- // t.Skipf("skipping test due to flakiness on Windows: https://golang.org/issue/49646") +- // } - - const pkgThatUsesVendoring = ` --- go.mod -- @@ -11791,9 +13411,56 @@ diff -urN a/gopls/internal/regtest/misc/vendor_test.go b/gopls/internal/regtest/ - ) - }) -} +diff -urN a/gopls/internal/regtest/misc/vuln_test.go b/gopls/internal/regtest/misc/vuln_test.go +--- a/gopls/internal/regtest/misc/vuln_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/vuln_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,43 +0,0 @@ +-// Copyright 2022 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. +- +-package misc +- +-import ( +- "testing" +- +- "golang.org/x/tools/internal/lsp/command" +- "golang.org/x/tools/internal/lsp/protocol" +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-func TestRunVulncheckExpError(t *testing.T) { +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- foo.go -- +-package foo +-` +- Run(t, files, func(t *testing.T, env *Env) { +- cmd, err := command.NewRunVulncheckExpCommand("Run Vulncheck Exp", command.VulncheckArgs{ +- Dir: "/invalid/file/url", // invalid arg +- }) +- if err != nil { +- t.Fatal(err) +- } +- +- params := &protocol.ExecuteCommandParams{ +- Command: command.RunVulncheckExp.ID(), +- Arguments: cmd.Arguments, +- } +- +- response, err := env.Editor.ExecuteCommand(env.Ctx, params) +- // We want an error! +- if err == nil { +- t.Errorf("got success, want invalid file URL error: %v", response) +- } +- }) +-} diff -urN a/gopls/internal/regtest/misc/workspace_symbol_test.go b/gopls/internal/regtest/misc/workspace_symbol_test.go ---- a/gopls/internal/regtest/misc/workspace_symbol_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/misc/workspace_symbol_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/internal/regtest/misc/workspace_symbol_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/misc/workspace_symbol_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,131 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -11927,9 +13594,9 @@ diff -urN a/gopls/internal/regtest/misc/workspace_symbol_test.go b/gopls/interna - } -} diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regtest/modfile/modfile_test.go ---- a/gopls/internal/regtest/modfile/modfile_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/modfile/modfile_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,1122 +0,0 @@ +--- a/gopls/internal/regtest/modfile/modfile_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/modfile/modfile_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,1199 +0,0 @@ -// Copyright 2020 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. @@ -11943,6 +13610,7 @@ diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regt - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - . "golang.org/x/tools/internal/lsp/regtest" - - "golang.org/x/tools/internal/lsp/protocol" @@ -11951,6 +13619,7 @@ diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regt -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - @@ -12171,6 +13840,62 @@ diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regt - }) -} - +-// Tests that multiple missing dependencies gives good single fixes. +-func TestMissingDependencyFixesWithGoWork(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) +- const mod = ` +--- go.work -- +-go 1.18 +- +-use ( +- ./a +-) +--- a/go.mod -- +-module mod.com +- +-go 1.12 +- +--- a/main.go -- +-package main +- +-import "example.com/blah" +-import "random.org/blah" +- +-var _, _ = blah.Name, hello.Name +-` +- +- const want = `module mod.com +- +-go 1.12 +- +-require random.org v1.2.3 +-` +- +- RunMultiple{ +- {"default", WithOptions(ProxyFiles(proxy), WorkspaceFolders("a"))}, +- {"nested", WithOptions(ProxyFiles(proxy))}, +- }.Run(t, mod, func(t *testing.T, env *Env) { +- env.OpenFile("a/main.go") +- var d protocol.PublishDiagnosticsParams +- env.Await( +- OnceMet( +- env.DiagnosticAtRegexp("a/main.go", `"random.org/blah"`), +- ReadDiagnostics("a/main.go", &d), +- ), +- ) +- var randomDiag protocol.Diagnostic +- for _, diag := range d.Diagnostics { +- if strings.Contains(diag.Message, "random.org") { +- randomDiag = diag +- } +- } +- env.ApplyQuickFixes("a/main.go", []protocol.Diagnostic{randomDiag}) +- if got := env.ReadWorkspaceFile("a/go.mod"); got != want { +- t.Fatalf("unexpected go.mod content:\n%s", tests.Diff(t, want, got)) +- } +- }) +-} +- -func TestIndirectDependencyFix(t *testing.T) { - testenv.NeedsGo1Point(t, 14) - @@ -12735,6 +14460,8 @@ diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regt -} - -func TestSumUpdateFixesDiagnostics(t *testing.T) { +- t.Skipf("Skipping known-flaky test; see https://go.dev/issue/51352.") +- - testenv.NeedsGo1Point(t, 14) - - const mod = ` @@ -13052,10 +14779,27 @@ diff -urN a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regt - ) - }) -} +- +-func TestInvalidGoVersion(t *testing.T) { +- testenv.NeedsGo1Point(t, 14) // Times out on 1.13 for reasons unclear. Not worth worrying about. +- const files = ` +--- go.mod -- +-module mod.com +- +-go foo +--- main.go -- +-package main +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.Await(env.DiagnosticAtRegexpWithMessage("go.mod", `go foo`, "invalid go version")) +- env.WriteWorkspaceFile("go.mod", "module mod.com \n\ngo 1.12\n") +- env.Await(EmptyDiagnostics("go.mod")) +- }) +-} diff -urN a/gopls/internal/regtest/template/template_test.go b/gopls/internal/regtest/template/template_test.go ---- a/gopls/internal/regtest/template/template_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/template/template_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,177 +0,0 @@ +--- a/gopls/internal/regtest/template/template_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/template/template_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,232 +0,0 @@ -// Copyright 2022 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. @@ -13067,14 +14811,51 @@ diff -urN a/gopls/internal/regtest/template/template_test.go b/gopls/internal/re - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - "golang.org/x/tools/internal/lsp/protocol" - . "golang.org/x/tools/internal/lsp/regtest" -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - +-func TestMultilineTokens(t *testing.T) { +- // 51731: panic: runtime error: slice bounds out of range [38:3] +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.17 +--- hi.tmpl -- +-{{if (foÜx .X.Y)}}😀{{$A := +- "hi" +- }}{{.Z $A}}{{else}} +-{{$A.X 12}} +-{{foo (.X.Y) 23 ($A.Z)}} +-{{end}} +-` +- WithOptions( +- EditorConfig{ +- Settings: map[string]interface{}{ +- "templateExtensions": []string{"tmpl"}, +- "semanticTokens": true, +- }, +- }, +- ).Run(t, files, func(t *testing.T, env *Env) { +- var p protocol.SemanticTokensParams +- p.TextDocument.URI = env.Sandbox.Workdir.URI("hi.tmpl") +- toks, err := env.Editor.Server.SemanticTokensFull(env.Ctx, &p) +- if err != nil { +- t.Errorf("semantic token failed: %v", err) +- } +- if toks == nil || len(toks.Data) == 0 { +- t.Errorf("got no semantic tokens") +- } +- }) +-} +- -func TestTemplatesFromExtensions(t *testing.T) { - const files = ` --- go.mod -- @@ -13086,16 +14867,35 @@ diff -urN a/gopls/internal/regtest/template/template_test.go b/gopls/internal/re -Hello {{}} <-- missing body -{{end}} -` -- - WithOptions( - EditorConfig{ - Settings: map[string]interface{}{ - "templateExtensions": []string{"tmpl"}, +- "semanticTokens": true, - }, - }, - ).Run(t, files, func(t *testing.T, env *Env) { - // TODO: can we move this diagnostic onto {{}}? - env.Await(env.DiagnosticAtRegexp("hello.tmpl", "()Hello {{}}")) +- d := env.DiagnosticsFor("hello.tmpl").Diagnostics // issue 50786: check for Source +- if len(d) != 1 { +- t.Errorf("expected 1 diagnostic, got %d", len(d)) +- return +- } +- if d[0].Source != "template" { +- t.Errorf("expected Source 'template', got %q", d[0].Source) +- } +- // issue 50801 (even broken templates could return some semantic tokens) +- var p protocol.SemanticTokensParams +- p.TextDocument.URI = env.Sandbox.Workdir.URI("hello.tmpl") +- toks, err := env.Editor.Server.SemanticTokensFull(env.Ctx, &p) +- if err != nil { +- t.Errorf("semantic token failed: %v", err) +- } +- if toks == nil || len(toks.Data) == 0 { +- t.Errorf("got no semantic tokens") +- } +- - env.WriteWorkspaceFile("hello.tmpl", "{{range .Planets}}\nHello {{.}}\n{{end}}") - env.Await(EmptyDiagnostics("hello.tmpl")) - }) @@ -13231,12 +15031,11 @@ diff -urN a/gopls/internal/regtest/template/template_test.go b/gopls/internal/re - return pieces[j-2] + "/" + pieces[j-1] -} - --// Hover, SemTok, Diagnose with errors --// and better coverage +-// Hover needs tests diff -urN a/gopls/internal/regtest/watch/watch_test.go b/gopls/internal/regtest/watch/watch_test.go ---- a/gopls/internal/regtest/watch/watch_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/watch/watch_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,766 +0,0 @@ +--- a/gopls/internal/regtest/watch/watch_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/watch/watch_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,768 +0,0 @@ -// Copyright 2020 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. @@ -13247,6 +15046,7 @@ diff -urN a/gopls/internal/regtest/watch/watch_test.go b/gopls/internal/regtest/ - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - . "golang.org/x/tools/internal/lsp/regtest" - - "golang.org/x/tools/internal/lsp/fake" @@ -13255,6 +15055,7 @@ diff -urN a/gopls/internal/regtest/watch/watch_test.go b/gopls/internal/regtest/ -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - Main(m, hooks.Options) -} - @@ -13659,593 +15460,1066 @@ diff -urN a/gopls/internal/regtest/watch/watch_test.go b/gopls/internal/regtest/ - }) - }) - -- t.Run("delete then close", func(t *testing.T) { -- WithOptions( -- EditorConfig{VerboseOutput: true}, -- ).Run(t, pkg, func(t *testing.T, env *Env) { -- env.OpenFile("a/a.go") -- env.OpenFile("a/a_unneeded.go") -- env.Await( -- OnceMet( -- env.DoneWithOpen(), -- LogMatching(protocol.Info, "a_unneeded.go", 1, false), -- ), -- ) +- t.Run("delete then close", func(t *testing.T) { +- WithOptions( +- EditorConfig{VerboseOutput: true}, +- ).Run(t, pkg, func(t *testing.T, env *Env) { +- env.OpenFile("a/a.go") +- env.OpenFile("a/a_unneeded.go") +- env.Await( +- OnceMet( +- env.DoneWithOpen(), +- LogMatching(protocol.Info, "a_unneeded.go", 1, false), +- ), +- ) +- +- // Delete and then close the file. +- env.RemoveWorkspaceFile("a/a_unneeded.go") +- env.CloseBuffer("a/a_unneeded.go") +- env.RegexpReplace("a/a.go", "var _ int", "fmt.Println(\"\")") +- env.Await( +- env.DiagnosticAtRegexp("a/a.go", "fmt"), +- ) +- env.SaveBuffer("a/a.go") +- env.Await( +- OnceMet( +- env.DoneWithSave(), +- // There should only be one log message containing +- // a_unneeded.go, from the initial workspace load, which we +- // check for earlier. If there are more, there's a bug. +- LogMatching(protocol.Info, "a_unneeded.go", 1, false), +- ), +- EmptyDiagnostics("a/a.go"), +- ) +- }) +- }) +-} +- +-// This change reproduces the behavior of switching branches, with multiple +-// files being created and deleted. The key change here is the movement of a +-// symbol from one file to another in a given package through a deletion and +-// creation. To reproduce an issue with metadata invalidation in batched +-// changes, the last change in the batch is an on-disk file change that doesn't +-// require metadata invalidation. +-func TestMoveSymbol(t *testing.T) { +- const pkg = ` +--- go.mod -- +-module mod.com +- +-go 1.14 +--- main.go -- +-package main +- +-import "mod.com/a" +- +-func main() { +- var x int +- x = a.Hello +- println(x) +-} +--- a/a1.go -- +-package a +- +-var Hello int +--- a/a2.go -- +-package a +- +-func _() {} +-` +- Run(t, pkg, func(t *testing.T, env *Env) { +- env.ChangeFilesOnDisk([]fake.FileEvent{ +- { +- Path: "a/a3.go", +- Content: `package a +- +-var Hello int +-`, +- ProtocolEvent: protocol.FileEvent{ +- URI: env.Sandbox.Workdir.URI("a/a3.go"), +- Type: protocol.Created, +- }, +- }, +- { +- Path: "a/a1.go", +- ProtocolEvent: protocol.FileEvent{ +- URI: env.Sandbox.Workdir.URI("a/a1.go"), +- Type: protocol.Deleted, +- }, +- }, +- { +- Path: "a/a2.go", +- Content: `package a; func _() {};`, +- ProtocolEvent: protocol.FileEvent{ +- URI: env.Sandbox.Workdir.URI("a/a2.go"), +- Type: protocol.Changed, +- }, +- }, +- }) +- env.Await( +- OnceMet( +- env.DoneWithChangeWatchedFiles(), +- NoDiagnostics("main.go"), +- ), +- ) +- }) +-} +- +-// Reproduce golang/go#40456. +-func TestChangeVersion(t *testing.T) { +- const proxy = ` +--- example.com@v1.2.3/go.mod -- +-module example.com +- +-go 1.12 +--- example.com@v1.2.3/blah/blah.go -- +-package blah +- +-const Name = "Blah" +- +-func X(x int) {} +--- example.com@v1.2.2/go.mod -- +-module example.com +- +-go 1.12 +--- example.com@v1.2.2/blah/blah.go -- +-package blah +- +-const Name = "Blah" +- +-func X() {} +--- random.org@v1.2.3/go.mod -- +-module random.org +- +-go 1.12 +--- random.org@v1.2.3/blah/blah.go -- +-package hello +- +-const Name = "Hello" +-` +- const mod = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +- +-require example.com v1.2.2 +--- main.go -- +-package main +- +-import "example.com/blah" +- +-func main() { +- blah.X() +-} +-` +- WithOptions(ProxyFiles(proxy)).Run(t, mod, func(t *testing.T, env *Env) { +- env.WriteWorkspaceFiles(map[string]string{ +- "go.mod": `module mod.com +- +-go 1.12 +- +-require example.com v1.2.3 +-`, +- "main.go": `package main +- +-import ( +- "example.com/blah" +-) +- +-func main() { +- blah.X(1) +-} +-`, +- }) +- env.Await( +- env.DoneWithChangeWatchedFiles(), +- NoDiagnostics("main.go"), +- ) +- }) +-} +- +-// Reproduces golang/go#40340. +-func TestSwitchFromGOPATHToModules(t *testing.T) { +- testenv.NeedsGo1Point(t, 13) - -- // Delete and then close the file. -- env.RemoveWorkspaceFile("a/a_unneeded.go") -- env.CloseBuffer("a/a_unneeded.go") -- env.RegexpReplace("a/a.go", "var _ int", "fmt.Println(\"\")") -- env.Await( -- env.DiagnosticAtRegexp("a/a.go", "fmt"), -- ) -- env.SaveBuffer("a/a.go") -- env.Await( -- OnceMet( -- env.DoneWithSave(), -- // There should only be one log message containing -- // a_unneeded.go, from the initial workspace load, which we -- // check for earlier. If there are more, there's a bug. -- LogMatching(protocol.Info, "a_unneeded.go", 1, false), -- ), -- EmptyDiagnostics("a/a.go"), -- ) -- }) +- const files = ` +--- foo/blah/blah.go -- +-package blah +- +-const Name = "" +--- foo/main.go -- +-package main +- +-import "blah" +- +-func main() { +- _ = blah.Name +-} +-` +- WithOptions( +- InGOPATH(), +- EditorConfig{ +- Env: map[string]string{ +- "GO111MODULE": "auto", +- }, +- }, +- Modes(Experimental), // module is in a subdirectory +- ).Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("foo/main.go") +- env.Await(env.DiagnosticAtRegexp("foo/main.go", `"blah"`)) +- if err := env.Sandbox.RunGoCommand(env.Ctx, "foo", "mod", []string{"init", "mod.com"}, true); err != nil { +- t.Fatal(err) +- } +- env.RegexpReplace("foo/main.go", `"blah"`, `"mod.com/blah"`) +- env.Await( +- EmptyDiagnostics("foo/main.go"), +- ) - }) -} - --// This change reproduces the behavior of switching branches, with multiple --// files being created and deleted. The key change here is the movement of a --// symbol from one file to another in a given package through a deletion and --// creation. To reproduce an issue with metadata invalidation in batched --// changes, the last change in the batch is an on-disk file change that doesn't --// require metadata invalidation. --func TestMoveSymbol(t *testing.T) { -- const pkg = ` ---- go.mod -- +-// Reproduces golang/go#40487. +-func TestSwitchFromModulesToGOPATH(t *testing.T) { +- testenv.NeedsGo1Point(t, 13) +- +- const files = ` +--- foo/go.mod -- -module mod.com - -go 1.14 ---- main.go -- +--- foo/blah/blah.go -- +-package blah +- +-const Name = "" +--- foo/main.go -- -package main - --import "mod.com/a" +-import "mod.com/blah" - -func main() { -- var x int -- x = a.Hello -- println(x) +- _ = blah.Name -} ---- a/a1.go -- +-` +- WithOptions( +- InGOPATH(), +- EditorConfig{ +- Env: map[string]string{ +- "GO111MODULE": "auto", +- }, +- }, +- ).Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("foo/main.go") +- env.RemoveWorkspaceFile("foo/go.mod") +- env.Await( +- OnceMet( +- env.DoneWithChangeWatchedFiles(), +- env.DiagnosticAtRegexp("foo/main.go", `"mod.com/blah"`), +- ), +- ) +- env.RegexpReplace("foo/main.go", `"mod.com/blah"`, `"foo/blah"`) +- env.Await( +- EmptyDiagnostics("foo/main.go"), +- ) +- }) +-} +- +-func TestNewSymbolInTestVariant(t *testing.T) { +- const files = ` +--- go.mod -- +-module mod.com +- +-go 1.12 +--- a/a.go -- -package a - --var Hello int ---- a/a2.go -- +-func bob() {} +--- a/a_test.go -- -package a - --func _() {} +-import "testing" +- +-func TestBob(t *testing.T) { +- bob() +-} -` -- Run(t, pkg, func(t *testing.T, env *Env) { -- env.ChangeFilesOnDisk([]fake.FileEvent{ -- { -- Path: "a/a3.go", -- Content: `package a +- Run(t, files, func(t *testing.T, env *Env) { +- // Add a new symbol to the package under test and use it in the test +- // variant. Expect no diagnostics. +- env.WriteWorkspaceFiles(map[string]string{ +- "a/a.go": `package a - --var Hello int +-func bob() {} +-func george() {} +-`, +- "a/a_test.go": `package a +- +-import "testing" +- +-func TestAll(t *testing.T) { +- bob() +- george() +-} -`, -- ProtocolEvent: protocol.FileEvent{ -- URI: env.Sandbox.Workdir.URI("a/a3.go"), -- Type: protocol.Created, -- }, -- }, -- { -- Path: "a/a1.go", -- ProtocolEvent: protocol.FileEvent{ -- URI: env.Sandbox.Workdir.URI("a/a1.go"), -- Type: protocol.Deleted, -- }, -- }, -- { -- Path: "a/a2.go", -- Content: `package a; func _() {};`, -- ProtocolEvent: protocol.FileEvent{ -- URI: env.Sandbox.Workdir.URI("a/a2.go"), -- Type: protocol.Changed, -- }, -- }, - }) - env.Await( - OnceMet( - env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("main.go"), +- NoDiagnostics("a/a.go"), +- ), +- OnceMet( +- env.DoneWithChangeWatchedFiles(), +- NoDiagnostics("a/a_test.go"), +- ), +- ) +- // Now, add a new file to the test variant and use its symbol in the +- // original test file. Expect no diagnostics. +- env.WriteWorkspaceFiles(map[string]string{ +- "a/a_test.go": `package a +- +-import "testing" +- +-func TestAll(t *testing.T) { +- bob() +- george() +- hi() +-} +-`, +- "a/a2_test.go": `package a +- +-import "testing" +- +-func hi() {} +- +-func TestSomething(t *testing.T) {} +-`, +- }) +- env.Await( +- OnceMet( +- env.DoneWithChangeWatchedFiles(), +- NoDiagnostics("a/a_test.go"), +- ), +- OnceMet( +- env.DoneWithChangeWatchedFiles(), +- NoDiagnostics("a/a2_test.go"), - ), - ) - }) -} +diff -urN a/gopls/internal/regtest/workspace/metadata_test.go b/gopls/internal/regtest/workspace/metadata_test.go +--- a/gopls/internal/regtest/workspace/metadata_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/workspace/metadata_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,43 +0,0 @@ +-// Copyright 2022 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. +- +-package workspace +- +-import ( +- "testing" +- +- . "golang.org/x/tools/internal/lsp/regtest" +- "golang.org/x/tools/internal/testenv" +-) +- +-// TODO(rfindley): move workspace tests related to metadata bugs into this +-// file. +- +-func TestFixImportDecl(t *testing.T) { +- // It appears that older Go versions don't even see p.go from the initial +- // workspace load. +- testenv.NeedsGo1Point(t, 15) +- const src = ` +--- go.mod -- +-module mod.test +- +-go 1.12 +--- p.go -- +-package p +- +-import ( +- _ "fmt" +- +-const C = 42 +-` +- +- Run(t, src, func(t *testing.T, env *Env) { +- env.OpenFile("p.go") +- env.RegexpReplace("p.go", "\"fmt\"", "\"fmt\"\n)") +- env.Await(OnceMet( +- env.DoneWithChange(), +- EmptyDiagnostics("p.go"), +- )) +- }) +-} +diff -urN a/gopls/internal/regtest/workspace/workspace_test.go b/gopls/internal/regtest/workspace/workspace_test.go +--- a/gopls/internal/regtest/workspace/workspace_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/regtest/workspace/workspace_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,1307 +0,0 @@ +-// Copyright 2020 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. - --// Reproduce golang/go#40456. --func TestChangeVersion(t *testing.T) { -- const proxy = ` ---- example.com@v1.2.3/go.mod -- --module example.com +-package workspace - --go 1.12 ---- example.com@v1.2.3/blah/blah.go -- --package blah +-import ( +- "fmt" +- "path/filepath" +- "sort" +- "strings" +- "testing" - --const Name = "Blah" +- "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" +- "golang.org/x/tools/internal/lsp/fake" +- "golang.org/x/tools/internal/lsp/protocol" +- "golang.org/x/tools/internal/lsp/source" +- "golang.org/x/tools/internal/testenv" - --func X(x int) {} ---- example.com@v1.2.2/go.mod -- +- . "golang.org/x/tools/internal/lsp/regtest" +-) +- +-func TestMain(m *testing.M) { +- bug.PanicOnBugs = true +- Main(m, hooks.Options) +-} +- +-const workspaceProxy = ` +--- example.com@v1.2.3/go.mod -- -module example.com - -go 1.12 ---- example.com@v1.2.2/blah/blah.go -- +--- example.com@v1.2.3/blah/blah.go -- -package blah - --const Name = "Blah" -- --func X() {} +-func SaySomething() { +- fmt.Println("something") +-} --- random.org@v1.2.3/go.mod -- -module random.org - -go 1.12 ---- random.org@v1.2.3/blah/blah.go -- --package hello +--- random.org@v1.2.3/bye/bye.go -- +-package bye - --const Name = "Hello" +-func Goodbye() { +- println("Bye") +-} -` -- const mod = ` ---- go.mod -- +- +-// TODO: Add a replace directive. +-const workspaceModule = ` +--- pkg/go.mod -- -module mod.com - --go 1.12 +-go 1.14 - --require example.com v1.2.2 ---- main.go -- +-require ( +- example.com v1.2.3 +- random.org v1.2.3 +-) +--- pkg/go.sum -- +-example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= +-example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= +-random.org v1.2.3 h1:+JE2Fkp7gS0zsHXGEQJ7hraom3pNTlkxC4b2qPfA+/Q= +-random.org v1.2.3/go.mod h1:E9KM6+bBX2g5ykHZ9H27w16sWo3QwgonyjM44Dnej3I= +--- pkg/main.go -- -package main - --import "example.com/blah" +-import ( +- "example.com/blah" +- "mod.com/inner" +- "random.org/bye" +-) - -func main() { -- blah.X() +- blah.SaySomething() +- inner.Hi() +- bye.Goodbye() -} --` -- WithOptions(ProxyFiles(proxy)).Run(t, mod, func(t *testing.T, env *Env) { -- env.WriteWorkspaceFiles(map[string]string{ -- "go.mod": `module mod.com +--- pkg/main2.go -- +-package main - --go 1.12 +-import "fmt" - --require example.com v1.2.3 --`, -- "main.go": `package main +-func _() { +- fmt.Print("%s") +-} +--- pkg/inner/inner.go -- +-package inner - --import ( -- "example.com/blah" --) +-import "example.com/blah" - --func main() { -- blah.X(1) +-func Hi() { +- blah.SaySomething() -} --`, +--- goodbye/bye/bye.go -- +-package bye +- +-func Bye() {} +--- goodbye/go.mod -- +-module random.org +- +-go 1.12 +-` +- +-// Confirm that find references returns all of the references in the module, +-// regardless of what the workspace root is. +-func TestReferences(t *testing.T) { +- for _, tt := range []struct { +- name, rootPath string +- }{ +- { +- name: "module root", +- rootPath: "pkg", +- }, +- { +- name: "subdirectory", +- rootPath: "pkg/inner", +- }, +- } { +- t.Run(tt.name, func(t *testing.T) { +- opts := []RunOption{ProxyFiles(workspaceProxy)} +- if tt.rootPath != "" { +- opts = append(opts, WorkspaceFolders(tt.rootPath)) +- } +- WithOptions(opts...).Run(t, workspaceModule, func(t *testing.T, env *Env) { +- f := "pkg/inner/inner.go" +- env.OpenFile(f) +- locations := env.References(f, env.RegexpSearch(f, `SaySomething`)) +- want := 3 +- if got := len(locations); got != want { +- t.Fatalf("expected %v locations, got %v", want, got) +- } +- }) +- }) +- } +-} +- +-// make sure that directory filters work +-func TestFilters(t *testing.T) { +- for _, tt := range []struct { +- name, rootPath string +- }{ +- { +- name: "module root", +- rootPath: "pkg", +- }, +- } { +- t.Run(tt.name, func(t *testing.T) { +- opts := []RunOption{ProxyFiles(workspaceProxy)} +- if tt.rootPath != "" { +- opts = append(opts, WorkspaceFolders(tt.rootPath)) +- } +- f := func(o *source.Options) { +- o.DirectoryFilters = append(o.DirectoryFilters, "-inner") +- } +- opts = append(opts, Options(f)) +- WithOptions(opts...).Run(t, workspaceModule, func(t *testing.T, env *Env) { +- syms := env.WorkspaceSymbol("Hi") +- sort.Slice(syms, func(i, j int) bool { return syms[i].ContainerName < syms[j].ContainerName }) +- for i, s := range syms { +- if strings.Contains(s.ContainerName, "/inner") { +- t.Errorf("%s %v %s %s %d\n", s.Name, s.Kind, s.ContainerName, tt.name, i) +- } +- } +- }) - }) +- } +-} +- +-// Make sure that analysis diagnostics are cleared for the whole package when +-// the only opened file is closed. This test was inspired by the experience in +-// VS Code, where clicking on a reference result triggers a +-// textDocument/didOpen without a corresponding textDocument/didClose. +-func TestClearAnalysisDiagnostics(t *testing.T) { +- WithOptions( +- ProxyFiles(workspaceProxy), +- WorkspaceFolders("pkg/inner"), +- ).Run(t, workspaceModule, func(t *testing.T, env *Env) { +- env.OpenFile("pkg/main.go") +- env.Await( +- env.DiagnosticAtRegexp("pkg/main2.go", "fmt.Print"), +- ) +- env.CloseBuffer("pkg/main.go") +- env.Await( +- EmptyDiagnostics("pkg/main2.go"), +- ) +- }) +-} +- +-// This test checks that gopls updates the set of files it watches when a +-// replace target is added to the go.mod. +-func TestWatchReplaceTargets(t *testing.T) { +- t.Skipf("skipping known-flaky test: see https://go.dev/issue/50748") +- +- WithOptions( +- ProxyFiles(workspaceProxy), +- WorkspaceFolders("pkg"), +- ).Run(t, workspaceModule, func(t *testing.T, env *Env) { +- // Add a replace directive and expect the files that gopls is watching +- // to change. +- dir := env.Sandbox.Workdir.URI("goodbye").SpanURI().Filename() +- goModWithReplace := fmt.Sprintf(`%s +-replace random.org => %s +-`, env.ReadWorkspaceFile("pkg/go.mod"), dir) +- env.WriteWorkspaceFile("pkg/go.mod", goModWithReplace) - env.Await( - env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("main.go"), +- UnregistrationMatching("didChangeWatchedFiles"), +- RegistrationMatching("didChangeWatchedFiles"), - ) - }) -} - --// Reproduces golang/go#40340. --func TestSwitchFromGOPATHToModules(t *testing.T) { -- testenv.NeedsGo1Point(t, 13) +-const workspaceModuleProxy = ` +--- example.com@v1.2.3/go.mod -- +-module example.com - -- const files = ` ---- foo/blah/blah.go -- +-go 1.12 +--- example.com@v1.2.3/blah/blah.go -- -package blah - --const Name = "" ---- foo/main.go -- --package main +-func SaySomething() { +- fmt.Println("something") +-} +--- b.com@v1.2.3/go.mod -- +-module b.com +- +-go 1.12 +--- b.com@v1.2.3/b/b.go -- +-package b +- +-func Hello() {} +-` +- +-func TestAutomaticWorkspaceModule_Interdependent(t *testing.T) { +- const multiModule = ` +--- moda/a/go.mod -- +-module a.com +- +-require b.com v1.2.3 +--- moda/a/go.sum -- +-b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= +-b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= +--- moda/a/a.go -- +-package a - --import "blah" +-import ( +- "b.com/b" +-) - -func main() { -- _ = blah.Name +- var x int +- _ = b.Hello() +-} +--- modb/go.mod -- +-module b.com +- +--- modb/b/b.go -- +-package b +- +-func Hello() int { +- var x int -} -` - WithOptions( -- InGOPATH(), -- EditorConfig{ -- Env: map[string]string{ -- "GO111MODULE": "auto", -- }, -- }, -- Modes(Experimental), // module is in a subdirectory -- ).Run(t, files, func(t *testing.T, env *Env) { -- env.OpenFile("foo/main.go") -- env.Await(env.DiagnosticAtRegexp("foo/main.go", `"blah"`)) -- if err := env.Sandbox.RunGoCommand(env.Ctx, "foo", "mod", []string{"init", "mod.com"}, true); err != nil { -- t.Fatal(err) -- } -- env.RegexpReplace("foo/main.go", `"blah"`, `"mod.com/blah"`) +- ProxyFiles(workspaceModuleProxy), +- Modes(Experimental), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { - env.Await( -- EmptyDiagnostics("foo/main.go"), +- env.DiagnosticAtRegexp("moda/a/a.go", "x"), +- env.DiagnosticAtRegexp("modb/b/b.go", "x"), +- env.NoDiagnosticAtRegexp("moda/a/a.go", `"b.com/b"`), - ) - }) -} - --// Reproduces golang/go#40487. --func TestSwitchFromModulesToGOPATH(t *testing.T) { -- testenv.NeedsGo1Point(t, 13) +-func TestMultiModuleWithExclude(t *testing.T) { +- testenv.NeedsGo1Point(t, 16) - -- const files = ` ---- foo/go.mod -- --module mod.com +- const proxy = ` +--- c.com@v1.2.3/go.mod -- +-module c.com - --go 1.14 ---- foo/blah/blah.go -- +-go 1.12 +- +-require b.com v1.2.3 +--- c.com@v1.2.3/blah/blah.go -- -package blah - --const Name = "" ---- foo/main.go -- --package main +-func SaySomething() { +- fmt.Println("something") +-} +--- b.com@v1.2.3/go.mod -- +-module b.com - --import "mod.com/blah" +-go 1.12 +--- b.com@v1.2.4/b/b.go -- +-package b +- +-func Hello() {} +--- b.com@v1.2.4/go.mod -- +-module b.com +- +-go 1.12 +--- b.com@v1.2.4/b/b.go -- +-package b +- +-func Hello() {} +-` +- const multiModule = ` +--- go.mod -- +-module a.com +- +-require c.com v1.2.3 +- +-exclude b.com v1.2.3 +--- go.sum -- +-c.com v1.2.3 h1:n07Dz9fYmpNqvZMwZi5NEqFcSHbvLa9lacMX+/g25tw= +-c.com v1.2.3/go.mod h1:/4TyYgU9Nu5tA4NymP5xyqE8R2VMzGD3TbJCwCOvHAg= +--- main.go -- +-package a - -func main() { -- _ = blah.Name +- var x int -} -` - WithOptions( -- InGOPATH(), -- EditorConfig{ -- Env: map[string]string{ -- "GO111MODULE": "auto", -- }, -- }, -- ).Run(t, files, func(t *testing.T, env *Env) { -- env.OpenFile("foo/main.go") -- env.RemoveWorkspaceFile("foo/go.mod") -- env.Await( -- OnceMet( -- env.DoneWithChangeWatchedFiles(), -- env.DiagnosticAtRegexp("foo/main.go", `"mod.com/blah"`), -- ), -- ) -- env.RegexpReplace("foo/main.go", `"mod.com/blah"`, `"foo/blah"`) +- ProxyFiles(proxy), +- Modes(Experimental), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { - env.Await( -- EmptyDiagnostics("foo/main.go"), +- env.DiagnosticAtRegexp("main.go", "x"), - ) - }) -} - --func TestNewSymbolInTestVariant(t *testing.T) { -- const files = ` ---- go.mod -- --module mod.com +-// This change tests that the version of the module used changes after it has +-// been deleted from the workspace. +-func TestDeleteModule_Interdependent(t *testing.T) { +- t.Skip("Skipping due to golang/go#46375: race due to orphaned file reloading") - --go 1.12 ---- a/a.go -- --package a +- const multiModule = ` +--- moda/a/go.mod -- +-module a.com - --func bob() {} ---- a/a_test.go -- +-require b.com v1.2.3 +--- moda/a/go.sum -- +-b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= +-b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= +--- moda/a/a.go -- -package a - --import "testing" +-import ( +- "b.com/b" +-) - --func TestBob(t *testing.T) { -- bob() +-func main() { +- var x int +- _ = b.Hello() +-} +--- modb/go.mod -- +-module b.com +- +--- modb/b/b.go -- +-package b +- +-func Hello() int { +- var x int -} -` -- Run(t, files, func(t *testing.T, env *Env) { -- // Add a new symbol to the package under test and use it in the test -- // variant. Expect no diagnostics. -- env.WriteWorkspaceFiles(map[string]string{ -- "a/a.go": `package a +- WithOptions( +- ProxyFiles(workspaceModuleProxy), +- Modes(Experimental), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- env.OpenFile("moda/a/a.go") +- env.Await(env.DoneWithOpen()) - --func bob() {} --func george() {} --`, -- "a/a_test.go": `package a +- original, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if want := "modb/b/b.go"; !strings.HasSuffix(original, want) { +- t.Errorf("expected %s, got %v", want, original) +- } +- env.CloseBuffer(original) +- env.Await(env.DoneWithClose()) - --import "testing" +- env.RemoveWorkspaceFile("modb/b/b.go") +- env.RemoveWorkspaceFile("modb/go.mod") +- env.Await( +- env.DoneWithChangeWatchedFiles(), +- ) - --func TestAll(t *testing.T) { -- bob() -- george() --} --`, -- }) +- d := protocol.PublishDiagnosticsParams{} - env.Await( - OnceMet( -- env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("a/a.go"), -- ), -- OnceMet( -- env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("a/a_test.go"), +- env.DiagnosticAtRegexpWithMessage("moda/a/go.mod", "require b.com v1.2.3", "b.com@v1.2.3 has not been downloaded"), +- ReadDiagnostics("moda/a/go.mod", &d), - ), - ) -- // Now, add a new file to the test variant and use its symbol in the -- // original test file. Expect no diagnostics. -- env.WriteWorkspaceFiles(map[string]string{ -- "a/a_test.go": `package a +- env.ApplyQuickFixes("moda/a/go.mod", d.Diagnostics) +- env.Await(env.DoneWithChangeWatchedFiles()) +- got, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if want := "b.com@v1.2.3/b/b.go"; !strings.HasSuffix(got, want) { +- t.Errorf("expected %s, got %v", want, got) +- } +- }) +-} - --import "testing" +-// Tests that the version of the module used changes after it has been added +-// to the workspace. +-func TestCreateModule_Interdependent(t *testing.T) { +- const multiModule = ` +--- moda/a/go.mod -- +-module a.com - --func TestAll(t *testing.T) { -- bob() -- george() -- hi() --} --`, -- "a/a2_test.go": `package a +-require b.com v1.2.3 +--- moda/a/go.sum -- +-b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= +-b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= +--- moda/a/a.go -- +-package a - --import "testing" +-import ( +- "b.com/b" +-) - --func hi() {} +-func main() { +- var x int +- _ = b.Hello() +-} +-` +- WithOptions( +- Modes(Experimental), +- ProxyFiles(workspaceModuleProxy), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- env.OpenFile("moda/a/a.go") +- original, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if want := "b.com@v1.2.3/b/b.go"; !strings.HasSuffix(original, want) { +- t.Errorf("expected %s, got %v", want, original) +- } +- env.CloseBuffer(original) +- env.WriteWorkspaceFiles(map[string]string{ +- "modb/go.mod": "module b.com", +- "modb/b/b.go": `package b - --func TestSomething(t *testing.T) {} +-func Hello() int { +- var x int +-} -`, - }) - env.Await( - OnceMet( - env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("a/a_test.go"), -- ), -- OnceMet( -- env.DoneWithChangeWatchedFiles(), -- NoDiagnostics("a/a2_test.go"), +- env.DiagnosticAtRegexp("modb/b/b.go", "x"), - ), - ) +- got, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if want := "modb/b/b.go"; !strings.HasSuffix(got, want) { +- t.Errorf("expected %s, got %v", want, original) +- } - }) -} -diff -urN a/gopls/internal/regtest/workspace/workspace_test.go b/gopls/internal/regtest/workspace/workspace_test.go ---- a/gopls/internal/regtest/workspace/workspace_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/internal/regtest/workspace/workspace_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,1163 +0,0 @@ --// Copyright 2020 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. - --package workspace +-// This test confirms that a gopls workspace can recover from initialization +-// with one invalid module. +-func TestOneBrokenModule(t *testing.T) { +- const multiModule = ` +--- moda/a/go.mod -- +-module a.com - --import ( -- "encoding/json" -- "fmt" -- "io/ioutil" -- "path/filepath" -- "sort" -- "strings" -- "testing" +-require b.com v1.2.3 - -- "golang.org/x/tools/gopls/internal/hooks" -- . "golang.org/x/tools/internal/lsp/regtest" -- "golang.org/x/tools/internal/lsp/source" +--- moda/a/a.go -- +-package a - -- "golang.org/x/tools/internal/lsp/command" -- "golang.org/x/tools/internal/lsp/fake" -- "golang.org/x/tools/internal/lsp/protocol" -- "golang.org/x/tools/internal/testenv" +-import ( +- "b.com/b" -) - --func TestMain(m *testing.M) { -- Main(m, hooks.Options) --} -- --const workspaceProxy = ` ---- example.com@v1.2.3/go.mod -- --module example.com -- --go 1.12 ---- example.com@v1.2.3/blah/blah.go -- --package blah -- --func SaySomething() { -- fmt.Println("something") +-func main() { +- var x int +- _ = b.Hello() -} ---- random.org@v1.2.3/go.mod -- --module random.org +--- modb/go.mod -- +-modul b.com // typo here - --go 1.12 ---- random.org@v1.2.3/bye/bye.go -- --package bye +--- modb/b/b.go -- +-package b - --func Goodbye() { -- println("Bye") +-func Hello() int { +- var x int -} -` +- WithOptions( +- ProxyFiles(workspaceModuleProxy), +- Modes(Experimental), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- env.OpenFile("modb/go.mod") +- env.Await( +- OnceMet( +- env.DoneWithOpen(), +- DiagnosticAt("modb/go.mod", 0, 0), +- ), +- ) +- env.RegexpReplace("modb/go.mod", "modul", "module") +- env.SaveBufferWithoutActions("modb/go.mod") +- env.Await( +- env.DiagnosticAtRegexp("modb/b/b.go", "x"), +- ) +- }) +-} - --// TODO: Add a replace directive. --const workspaceModule = ` ---- pkg/go.mod -- --module mod.com -- --go 1.14 +-func TestUseGoplsMod(t *testing.T) { +- // This test validates certain functionality related to using a gopls.mod +- // file to specify workspace modules. +- testenv.NeedsGo1Point(t, 14) +- const multiModule = ` +--- moda/a/go.mod -- +-module a.com - --require ( -- example.com v1.2.3 -- random.org v1.2.3 --) ---- pkg/go.sum -- --example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= --example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= --random.org v1.2.3 h1:+JE2Fkp7gS0zsHXGEQJ7hraom3pNTlkxC4b2qPfA+/Q= --random.org v1.2.3/go.mod h1:E9KM6+bBX2g5ykHZ9H27w16sWo3QwgonyjM44Dnej3I= ---- pkg/main.go -- --package main +-require b.com v1.2.3 +--- moda/a/go.sum -- +-b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= +-b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= +--- moda/a/a.go -- +-package a - -import ( -- "example.com/blah" -- "mod.com/inner" -- "random.org/bye" +- "b.com/b" -) - -func main() { -- blah.SaySomething() -- inner.Hi() -- bye.Goodbye() --} ---- pkg/main2.go -- --package main -- --import "fmt" -- --func _() { -- fmt.Print("%s") +- var x int +- _ = b.Hello() -} ---- pkg/inner/inner.go -- --package inner +--- modb/go.mod -- +-module b.com - --import "example.com/blah" +-require example.com v1.2.3 +--- modb/go.sum -- +-example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= +-example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= +--- modb/b/b.go -- +-package b - --func Hi() { -- blah.SaySomething() +-func Hello() int { +- var x int -} ---- goodbye/bye/bye.go -- --package bye +--- gopls.mod -- +-module gopls-workspace - --func Bye() {} ---- goodbye/go.mod -- --module random.org +-require ( +- a.com v0.0.0-goplsworkspace +- b.com v1.2.3 +-) - --go 1.12 +-replace a.com => $SANDBOX_WORKDIR/moda/a -` +- WithOptions( +- ProxyFiles(workspaceModuleProxy), +- Modes(Experimental), +- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- // Initially, the gopls.mod should cause only the a.com module to be +- // loaded. Validate this by jumping to a definition in b.com and ensuring +- // that we go to the module cache. +- env.OpenFile("moda/a/a.go") +- env.Await(env.DoneWithOpen()) - --// Confirm that find references returns all of the references in the module, --// regardless of what the workspace root is. --func TestReferences(t *testing.T) { -- for _, tt := range []struct { -- name, rootPath string -- }{ -- { -- name: "module root", -- rootPath: "pkg", -- }, -- { -- name: "subdirectory", -- rootPath: "pkg/inner", -- }, -- } { -- t.Run(tt.name, func(t *testing.T) { -- opts := []RunOption{ProxyFiles(workspaceProxy)} -- if tt.rootPath != "" { -- opts = append(opts, WorkspaceFolders(tt.rootPath)) +- // To verify which modules are loaded, we'll jump to the definition of +- // b.Hello. +- checkHelloLocation := func(want string) error { +- location, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if !strings.HasSuffix(location, want) { +- return fmt.Errorf("expected %s, got %v", want, location) - } -- WithOptions(opts...).Run(t, workspaceModule, func(t *testing.T, env *Env) { -- f := "pkg/inner/inner.go" -- env.OpenFile(f) -- locations := env.References(f, env.RegexpSearch(f, `SaySomething`)) -- want := 3 -- if got := len(locations); got != want { -- t.Fatalf("expected %v locations, got %v", want, got) -- } -- }) -- }) -- } --} +- return nil +- } - --// make sure that directory filters work --func TestFilters(t *testing.T) { -- for _, tt := range []struct { -- name, rootPath string -- }{ -- { -- name: "module root", -- rootPath: "pkg", -- }, -- } { -- t.Run(tt.name, func(t *testing.T) { -- opts := []RunOption{ProxyFiles(workspaceProxy)} -- if tt.rootPath != "" { -- opts = append(opts, WorkspaceFolders(tt.rootPath)) -- } -- f := func(o *source.Options) { -- o.DirectoryFilters = append(o.DirectoryFilters, "-inner") -- } -- opts = append(opts, Options(f)) -- WithOptions(opts...).Run(t, workspaceModule, func(t *testing.T, env *Env) { -- syms := env.WorkspaceSymbol("Hi") -- sort.Slice(syms, func(i, j int) bool { return syms[i].ContainerName < syms[j].ContainerName }) -- for i, s := range syms { -- if strings.Contains(s.ContainerName, "/inner") { -- t.Errorf("%s %v %s %s %d\n", s.Name, s.Kind, s.ContainerName, tt.name, i) -- } -- } -- }) -- }) -- } --} +- // Initially this should be in the module cache, as b.com is not replaced. +- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { +- t.Fatal(err) +- } +- +- // Now, modify the gopls.mod file on disk to activate the b.com module in +- // the workspace. +- workdir := env.Sandbox.Workdir.RootURI().SpanURI().Filename() +- env.WriteWorkspaceFile("gopls.mod", fmt.Sprintf(`module gopls-workspace - --// Make sure that analysis diagnostics are cleared for the whole package when --// the only opened file is closed. This test was inspired by the experience in --// VS Code, where clicking on a reference result triggers a --// textDocument/didOpen without a corresponding textDocument/didClose. --func TestClearAnalysisDiagnostics(t *testing.T) { -- WithOptions( -- ProxyFiles(workspaceProxy), -- WorkspaceFolders("pkg/inner"), -- ).Run(t, workspaceModule, func(t *testing.T, env *Env) { -- env.OpenFile("pkg/main.go") -- env.Await( -- env.DiagnosticAtRegexp("pkg/main2.go", "fmt.Print"), -- ) -- env.CloseBuffer("pkg/main.go") -- env.Await( -- EmptyDiagnostics("pkg/main2.go"), -- ) -- }) --} +-require ( +- a.com v1.9999999.0-goplsworkspace +- b.com v1.9999999.0-goplsworkspace +-) - --// This test checks that gopls updates the set of files it watches when a --// replace target is added to the go.mod. --func TestWatchReplaceTargets(t *testing.T) { -- t.Skipf("skipping known-flaky test: see https://go.dev/issue/50748") +-replace a.com => %s/moda/a +-replace b.com => %s/modb +-`, workdir, workdir)) +- env.Await(env.DoneWithChangeWatchedFiles()) +- // Check that go.mod diagnostics picked up the newly active mod file. +- // The local version of modb has an extra dependency we need to download. +- env.OpenFile("modb/go.mod") +- env.Await(env.DoneWithOpen()) - -- WithOptions( -- ProxyFiles(workspaceProxy), -- WorkspaceFolders("pkg"), -- ).Run(t, workspaceModule, func(t *testing.T, env *Env) { -- // Add a replace directive and expect the files that gopls is watching -- // to change. -- dir := env.Sandbox.Workdir.URI("goodbye").SpanURI().Filename() -- goModWithReplace := fmt.Sprintf(`%s --replace random.org => %s --`, env.ReadWorkspaceFile("pkg/go.mod"), dir) -- env.WriteWorkspaceFile("pkg/go.mod", goModWithReplace) +- var d protocol.PublishDiagnosticsParams - env.Await( -- env.DoneWithChangeWatchedFiles(), -- UnregistrationMatching("didChangeWatchedFiles"), -- RegistrationMatching("didChangeWatchedFiles"), +- OnceMet( +- env.DiagnosticAtRegexpWithMessage("modb/go.mod", `require example.com v1.2.3`, "has not been downloaded"), +- ReadDiagnostics("modb/go.mod", &d), +- ), - ) -- }) --} +- env.ApplyQuickFixes("modb/go.mod", d.Diagnostics) +- env.Await(env.DiagnosticAtRegexp("modb/b/b.go", "x")) +- // Jumping to definition should now go to b.com in the workspace. +- if err := checkHelloLocation("modb/b/b.go"); err != nil { +- t.Fatal(err) +- } - --const workspaceModuleProxy = ` ---- example.com@v1.2.3/go.mod -- --module example.com +- // Now, let's modify the gopls.mod *overlay* (not on disk), and verify that +- // this change is only picked up once it is saved. +- env.OpenFile("gopls.mod") +- env.Await(env.DoneWithOpen()) +- env.SetBufferContent("gopls.mod", fmt.Sprintf(`module gopls-workspace - --go 1.12 ---- example.com@v1.2.3/blah/blah.go -- --package blah +-require ( +- a.com v0.0.0-goplsworkspace +-) - --func SaySomething() { -- fmt.Println("something") --} ---- b.com@v1.2.3/go.mod -- --module b.com +-replace a.com => %s/moda/a +-`, workdir)) - --go 1.12 ---- b.com@v1.2.3/b/b.go -- --package b +- // Editing the gopls.mod removes modb from the workspace modules, and so +- // should clear outstanding diagnostics... +- env.Await(OnceMet( +- env.DoneWithChange(), +- EmptyDiagnostics("modb/go.mod"), +- )) +- // ...but does not yet cause a workspace reload, so we should still jump to modb. +- if err := checkHelloLocation("modb/b/b.go"); err != nil { +- t.Fatal(err) +- } +- // Saving should reload the workspace. +- env.SaveBufferWithoutActions("gopls.mod") +- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { +- t.Fatal(err) +- } +- }) +-} - --func Hello() {} +-// TestBadGoWork exercises the panic from golang/vscode-go#2121. +-func TestBadGoWork(t *testing.T) { +- const files = ` +--- go.work -- +-use ./bar +--- bar/go.mod -- +-module example.com/bar -` +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("go.work") +- }) +-} - --func TestAutomaticWorkspaceModule_Interdependent(t *testing.T) { +-func TestUseGoWork(t *testing.T) { +- // This test validates certain functionality related to using a go.work +- // file to specify workspace modules. +- testenv.NeedsGo1Point(t, 14) - const multiModule = ` --- moda/a/go.mod -- -module a.com @@ -14268,98 +16542,223 @@ diff -urN a/gopls/internal/regtest/workspace/workspace_test.go b/gopls/internal/ --- modb/go.mod -- -module b.com - +-require example.com v1.2.3 +--- modb/go.sum -- +-example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= +-example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= --- modb/b/b.go -- -package b - -func Hello() int { - var x int -} +--- go.work -- +-go 1.17 +- +-use ( +- ./moda/a +-) -` - WithOptions( - ProxyFiles(workspaceModuleProxy), -- Modes(Experimental), - ).Run(t, multiModule, func(t *testing.T, env *Env) { +- // Initially, the go.work should cause only the a.com module to be +- // loaded. Validate this by jumping to a definition in b.com and ensuring +- // that we go to the module cache. +- env.OpenFile("moda/a/a.go") +- env.Await(env.DoneWithOpen()) +- +- // To verify which modules are loaded, we'll jump to the definition of +- // b.Hello. +- checkHelloLocation := func(want string) error { +- location, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- if !strings.HasSuffix(location, want) { +- return fmt.Errorf("expected %s, got %v", want, location) +- } +- return nil +- } +- +- // Initially this should be in the module cache, as b.com is not replaced. +- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { +- t.Fatal(err) +- } +- +- // Now, modify the go.work file on disk to activate the b.com module in +- // the workspace. +- env.WriteWorkspaceFile("go.work", ` +-go 1.17 +- +-use ( +- ./moda/a +- ./modb +-) +-`) +- env.Await(env.DoneWithChangeWatchedFiles()) +- // Check that go.mod diagnostics picked up the newly active mod file. +- // The local version of modb has an extra dependency we need to download. +- env.OpenFile("modb/go.mod") +- env.Await(env.DoneWithOpen()) +- +- var d protocol.PublishDiagnosticsParams - env.Await( -- env.DiagnosticAtRegexp("moda/a/a.go", "x"), -- env.DiagnosticAtRegexp("modb/b/b.go", "x"), -- env.NoDiagnosticAtRegexp("moda/a/a.go", `"b.com/b"`), +- OnceMet( +- env.DiagnosticAtRegexpWithMessage("modb/go.mod", `require example.com v1.2.3`, "has not been downloaded"), +- ReadDiagnostics("modb/go.mod", &d), +- ), - ) -- }) --} +- env.ApplyQuickFixes("modb/go.mod", d.Diagnostics) +- env.Await(env.DiagnosticAtRegexp("modb/b/b.go", "x")) - --func TestMultiModuleWithExclude(t *testing.T) { -- testenv.NeedsGo1Point(t, 16) +- // Jumping to definition should now go to b.com in the workspace. +- if err := checkHelloLocation("modb/b/b.go"); err != nil { +- t.Fatal(err) +- } - -- const proxy = ` ---- c.com@v1.2.3/go.mod -- --module c.com +- // Now, let's modify the go.work *overlay* (not on disk), and verify that +- // this change is only picked up once it is saved. +- env.OpenFile("go.work") +- env.Await(env.DoneWithOpen()) +- env.SetBufferContent("go.work", `go 1.17 - --go 1.12 +-use ( +- ./moda/a +-)`) - --require b.com v1.2.3 ---- c.com@v1.2.3/blah/blah.go -- --package blah +- // Simply modifying the go.work file does not cause a reload, so we should +- // still jump within the workspace. +- // +- // TODO: should editing the go.work above cause modb diagnostics to be +- // suppressed? +- env.Await(env.DoneWithChange()) +- if err := checkHelloLocation("modb/b/b.go"); err != nil { +- t.Fatal(err) +- } - --func SaySomething() { -- fmt.Println("something") --} ---- b.com@v1.2.3/go.mod -- --module b.com +- // Saving should reload the workspace. +- env.SaveBufferWithoutActions("go.work") +- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { +- t.Fatal(err) +- } - --go 1.12 ---- b.com@v1.2.4/b/b.go -- --package b +- // This fails if guarded with a OnceMet(DoneWithSave(), ...), because it is +- // debounced (and therefore not synchronous with the change). +- env.Await(EmptyOrNoDiagnostics("modb/go.mod")) - --func Hello() {} ---- b.com@v1.2.4/go.mod -- --module b.com +- // Test Formatting. +- env.SetBufferContent("go.work", `go 1.18 +- use ( - --go 1.12 ---- b.com@v1.2.4/b/b.go -- --package b - --func Hello() {} --` -- const multiModule = ` ---- go.mod -- --module a.com - --require c.com v1.2.3 +- ./moda/a +-) +-`) // TODO(matloob): For some reason there's a "start position 7:0 is out of bounds" error when the ")" is on the last character/line in the file. Rob probably knows what's going on. +- env.SaveBuffer("go.work") +- env.Await(env.DoneWithSave()) +- gotWorkContents := env.ReadWorkspaceFile("go.work") +- wantWorkContents := `go 1.18 - --exclude b.com v1.2.3 ---- go.sum -- --c.com v1.2.3 h1:n07Dz9fYmpNqvZMwZi5NEqFcSHbvLa9lacMX+/g25tw= --c.com v1.2.3/go.mod h1:/4TyYgU9Nu5tA4NymP5xyqE8R2VMzGD3TbJCwCOvHAg= ---- main.go -- --package a +-use ( +- ./moda/a +-) +-` +- if gotWorkContents != wantWorkContents { +- t.Fatalf("formatted contents of workspace: got %q; want %q", gotWorkContents, wantWorkContents) +- } +- }) +-} - --func main() { -- var x int +-func TestUseGoWorkDiagnosticMissingModule(t *testing.T) { +- const files = ` +--- go.work -- +-go 1.18 +- +-use ./foo +--- bar/go.mod -- +-module example.com/bar +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("go.work") +- env.Await( +- env.DiagnosticAtRegexpWithMessage("go.work", "use", "directory ./foo does not contain a module"), +- ) +- // The following tests is a regression test against an issue where we weren't +- // copying the workFile struct field on workspace when a new one was created in +- // (*workspace).invalidate. Set the buffer content to a working file so that +- // invalidate recognizes the workspace to be change and copies over the workspace +- // struct, and then set the content back to the old contents to make sure +- // the diagnostic still shows up. +- env.SetBufferContent("go.work", "go 1.18 \n\n use ./bar\n") +- env.Await( +- env.NoDiagnosticAtRegexp("go.work", "use"), +- ) +- env.SetBufferContent("go.work", "go 1.18 \n\n use ./foo\n") +- env.Await( +- env.DiagnosticAtRegexpWithMessage("go.work", "use", "directory ./foo does not contain a module"), +- ) +- }) -} +- +-func TestUseGoWorkDiagnosticSyntaxError(t *testing.T) { +- const files = ` +--- go.work -- +-go 1.18 +- +-usa ./foo +-replace -` -- WithOptions( -- ProxyFiles(proxy), -- Modes(Experimental), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("go.work") - env.Await( -- env.DiagnosticAtRegexp("main.go", "x"), +- env.DiagnosticAtRegexpWithMessage("go.work", "usa", "unknown directive: usa"), +- env.DiagnosticAtRegexpWithMessage("go.work", "replace", "usage: replace"), - ) - }) -} - --// This change tests that the version of the module used changes after it has --// been deleted from the workspace. --func TestDeleteModule_Interdependent(t *testing.T) { -- t.Skip("Skipping due to golang/go#46375: race due to orphaned file reloading") +-func TestUseGoWorkHover(t *testing.T) { +- const files = ` +--- go.work -- +-go 1.18 - -- const multiModule = ` +-use ./foo +-use ( +- ./bar +- ./bar/baz +-) +--- foo/go.mod -- +-module example.com/foo +--- bar/go.mod -- +-module example.com/bar +--- bar/baz/go.mod -- +-module example.com/bar/baz +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.OpenFile("go.work") +- +- tcs := map[string]string{ +- `\./foo`: "example.com/foo", +- `(?m)\./bar$`: "example.com/bar", +- `\./bar/baz`: "example.com/bar/baz", +- } +- +- for hoverRE, want := range tcs { +- pos := env.RegexpSearch("go.work", hoverRE) +- got, _ := env.Hover("go.work", pos) +- if got.Value != want { +- t.Errorf(`hover on %q: got %q, want %q`, hoverRE, got, want) +- } +- } +- }) +-} +- +-func TestExpandToGoWork(t *testing.T) { +- testenv.NeedsGo1Point(t, 18) +- const workspace = ` --- moda/a/go.mod -- -module a.com - -require b.com v1.2.3 ---- moda/a/go.sum -- --b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= --b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= --- moda/a/a.go -- -package a - @@ -14374,126 +16773,77 @@ diff -urN a/gopls/internal/regtest/workspace/workspace_test.go b/gopls/internal/ --- modb/go.mod -- -module b.com - +-require example.com v1.2.3 --- modb/b/b.go -- -package b - -func Hello() int { - var x int -} +--- go.work -- +-go 1.17 +- +-use ( +- ./moda/a +- ./modb +-) -` - WithOptions( -- ProxyFiles(workspaceModuleProxy), -- Modes(Experimental), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { +- WorkspaceFolders("moda/a"), +- ).Run(t, workspace, func(t *testing.T, env *Env) { - env.OpenFile("moda/a/a.go") - env.Await(env.DoneWithOpen()) -- -- original, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if want := "modb/b/b.go"; !strings.HasSuffix(original, want) { -- t.Errorf("expected %s, got %v", want, original) -- } -- env.CloseBuffer(original) -- env.Await(env.DoneWithClose()) -- -- env.RemoveWorkspaceFile("modb/b/b.go") -- env.RemoveWorkspaceFile("modb/go.mod") -- env.Await( -- env.DoneWithChangeWatchedFiles(), -- ) -- -- d := protocol.PublishDiagnosticsParams{} -- env.Await( -- OnceMet( -- env.DiagnosticAtRegexpWithMessage("moda/a/go.mod", "require b.com v1.2.3", "b.com@v1.2.3 has not been downloaded"), -- ReadDiagnostics("moda/a/go.mod", &d), -- ), -- ) -- env.ApplyQuickFixes("moda/a/go.mod", d.Diagnostics) -- env.Await(env.DoneWithChangeWatchedFiles()) -- got, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if want := "b.com@v1.2.3/b/b.go"; !strings.HasSuffix(got, want) { -- t.Errorf("expected %s, got %v", want, got) +- location, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) +- want := "modb/b/b.go" +- if !strings.HasSuffix(location, want) { +- t.Errorf("expected %s, got %v", want, location) - } - }) -} - --// Tests that the version of the module used changes after it has been added --// to the workspace. --func TestCreateModule_Interdependent(t *testing.T) { -- const multiModule = ` ---- moda/a/go.mod -- --module a.com -- --require b.com v1.2.3 ---- moda/a/go.sum -- --b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= --b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= ---- moda/a/a.go -- --package a +-func TestNonWorkspaceFileCreation(t *testing.T) { +- testenv.NeedsGo1Point(t, 13) - --import ( -- "b.com/b" --) +- const files = ` +--- go.mod -- +-module mod.com - --func main() { -- var x int -- _ = b.Hello() --} +-go 1.12 +--- x.go -- +-package x -` -- WithOptions( -- Modes(Experimental), -- ProxyFiles(workspaceModuleProxy), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { -- env.OpenFile("moda/a/a.go") -- original, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if want := "b.com@v1.2.3/b/b.go"; !strings.HasSuffix(original, want) { -- t.Errorf("expected %s, got %v", want, original) -- } -- env.CloseBuffer(original) -- env.WriteWorkspaceFiles(map[string]string{ -- "modb/go.mod": "module b.com", -- "modb/b/b.go": `package b - --func Hello() int { -- var x int --} --`, -- }) -- env.Await( -- OnceMet( -- env.DoneWithChangeWatchedFiles(), -- env.DiagnosticAtRegexp("modb/b/b.go", "x"), -- ), -- ) -- got, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if want := "modb/b/b.go"; !strings.HasSuffix(got, want) { -- t.Errorf("expected %s, got %v", want, original) -- } +- const code = ` +-package foo +-import "fmt" +-var _ = fmt.Printf +-` +- Run(t, files, func(t *testing.T, env *Env) { +- env.CreateBuffer("/tmp/foo.go", "") +- env.EditBuffer("/tmp/foo.go", fake.NewEdit(0, 0, 0, 0, code)) +- env.GoToDefinition("/tmp/foo.go", env.RegexpSearch("/tmp/foo.go", `Printf`)) - }) -} - --// This test confirms that a gopls workspace can recover from initialization --// with one invalid module. --func TestOneBrokenModule(t *testing.T) { +-func TestMultiModuleV2(t *testing.T) { - const multiModule = ` --- moda/a/go.mod -- -module a.com - --require b.com v1.2.3 -- +-require b.com/v2 v2.1.9 --- moda/a/a.go -- -package a - -import ( -- "b.com/b" +- "b.com/v2/b" -) - -func main() { - var x int -- _ = b.Hello() +- _ = b.Hi() -} --- modb/go.mod -- --modul b.com // typo here +-module b.com - --- modb/b/b.go -- -package b @@ -14501,679 +16851,875 @@ diff -urN a/gopls/internal/regtest/workspace/workspace_test.go b/gopls/internal/ -func Hello() int { - var x int -} +--- modb/v2/go.mod -- +-module b.com/v2 +- +--- modb/v2/b/b.go -- +-package b +- +-func Hi() int { +- var x int +-} +--- modc/go.mod -- +-module gopkg.in/yaml.v1 // test gopkg.in versions +--- modc/main.go -- +-package main +- +-func main() { +- var x int +-} -` - WithOptions( -- ProxyFiles(workspaceModuleProxy), - Modes(Experimental), - ).Run(t, multiModule, func(t *testing.T, env *Env) { -- env.OpenFile("modb/go.mod") - env.Await( -- OnceMet( -- env.DoneWithOpen(), -- DiagnosticAt("modb/go.mod", 0, 0), -- ), +- env.DiagnosticAtRegexp("moda/a/a.go", "x"), +- env.DiagnosticAtRegexp("modb/b/b.go", "x"), +- env.DiagnosticAtRegexp("modb/v2/b/b.go", "x"), +- env.DiagnosticAtRegexp("modc/main.go", "x"), - ) -- env.RegexpReplace("modb/go.mod", "modul", "module") -- env.SaveBufferWithoutActions("modb/go.mod") +- }) +-} +- +-func TestDirectoryFiltersLoads(t *testing.T) { +- // exclude, and its error, should be excluded from the workspace. +- const files = ` +--- go.mod -- +-module example.com +- +-go 1.12 +--- exclude/exclude.go -- +-package exclude +- +-const _ = Nonexistant +-` +- cfg := EditorConfig{ +- DirectoryFilters: []string{"-exclude"}, +- } +- WithOptions(cfg).Run(t, files, func(t *testing.T, env *Env) { +- env.Await(NoDiagnostics("exclude/x.go")) +- }) +-} +- +-func TestDirectoryFiltersTransitiveDep(t *testing.T) { +- // Even though exclude is excluded from the workspace, it should +- // still be importable as a non-workspace package. +- const files = ` +--- go.mod -- +-module example.com +- +-go 1.12 +--- include/include.go -- +-package include +-import "example.com/exclude" +- +-const _ = exclude.X +--- exclude/exclude.go -- +-package exclude +- +-const _ = Nonexistant // should be ignored, since this is a non-workspace package +-const X = 1 +-` +- +- cfg := EditorConfig{ +- DirectoryFilters: []string{"-exclude"}, +- } +- WithOptions(cfg).Run(t, files, func(t *testing.T, env *Env) { - env.Await( -- env.DiagnosticAtRegexp("modb/b/b.go", "x"), +- NoDiagnostics("exclude/exclude.go"), // filtered out +- NoDiagnostics("include/include.go"), // successfully builds - ) - }) -} - --func TestUseGoplsMod(t *testing.T) { -- // This test validates certain functionality related to using a gopls.mod -- // file to specify workspace modules. -- testenv.NeedsGo1Point(t, 14) -- const multiModule = ` ---- moda/a/go.mod -- --module a.com +-func TestDirectoryFiltersWorkspaceModules(t *testing.T) { +- // Define a module include.com which should be in the workspace, plus a +- // module exclude.com which should be excluded and therefore come from +- // the proxy. +- const files = ` +--- include/go.mod -- +-module include.com - --require b.com v1.2.3 ---- moda/a/go.sum -- --b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= --b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= ---- moda/a/a.go -- --package a +-go 1.12 - --import ( -- "b.com/b" --) +-require exclude.com v1.0.0 +- +--- include/go.sum -- +-exclude.com v1.0.0 h1:Q5QSfDXY5qyNCBeUiWovUGqcLCRZKoTs9XdBeVz+w1I= +-exclude.com v1.0.0/go.mod h1:hFox2uDlNB2s2Jfd9tHlQVfgqUiLVTmh6ZKat4cvnj4= +- +--- include/include.go -- +-package include - --func main() { -- var x int -- _ = b.Hello() --} ---- modb/go.mod -- --module b.com +-import "exclude.com" - --require example.com v1.2.3 ---- modb/go.sum -- --example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= --example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= ---- modb/b/b.go -- --package b +-var _ = exclude.X // satisfied only by the workspace version +--- exclude/go.mod -- +-module exclude.com - --func Hello() int { -- var x int --} ---- gopls.mod -- --module gopls-workspace +-go 1.12 +--- exclude/exclude.go -- +-package exclude - --require ( -- a.com v0.0.0-goplsworkspace -- b.com v1.2.3 --) +-const X = 1 +-` +- const proxy = ` +--- exclude.com@v1.0.0/go.mod -- +-module exclude.com - --replace a.com => $SANDBOX_WORKDIR/moda/a +-go 1.12 +--- exclude.com@v1.0.0/exclude.go -- +-package exclude -` -- WithOptions( -- ProxyFiles(workspaceModuleProxy), -- Modes(Experimental), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { -- // Initially, the gopls.mod should cause only the a.com module to be -- // loaded. Validate this by jumping to a definition in b.com and ensuring -- // that we go to the module cache. -- env.OpenFile("moda/a/a.go") -- env.Await(env.DoneWithOpen()) +- cfg := EditorConfig{ +- DirectoryFilters: []string{"-exclude"}, +- } +- WithOptions(cfg, Modes(Experimental), ProxyFiles(proxy)).Run(t, files, func(t *testing.T, env *Env) { +- env.Await(env.DiagnosticAtRegexp("include/include.go", `exclude.(X)`)) +- }) +-} - -- // To verify which modules are loaded, we'll jump to the definition of -- // b.Hello. -- checkHelloLocation := func(want string) error { -- location, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if !strings.HasSuffix(location, want) { -- return fmt.Errorf("expected %s, got %v", want, location) -- } -- return nil -- } +-// Confirm that a fix for a tidy module will correct all modules in the +-// workspace. +-func TestMultiModule_OneBrokenModule(t *testing.T) { +- testenv.NeedsGo1Point(t, 15) - -- // Initially this should be in the module cache, as b.com is not replaced. -- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { -- t.Fatal(err) -- } +- const mod = ` +--- a/go.mod -- +-module a.com - -- // Now, modify the gopls.mod file on disk to activate the b.com module in -- // the workspace. -- workdir := env.Sandbox.Workdir.RootURI().SpanURI().Filename() -- env.WriteWorkspaceFile("gopls.mod", fmt.Sprintf(`module gopls-workspace +-go 1.12 +--- a/main.go -- +-package main +--- b/go.mod -- +-module b.com +- +-go 1.12 - -require ( -- a.com v1.9999999.0-goplsworkspace -- b.com v1.9999999.0-goplsworkspace +- example.com v1.2.3 -) +--- b/go.sum -- +--- b/main.go -- +-package b - --replace a.com => %s/moda/a --replace b.com => %s/modb --`, workdir, workdir)) -- env.Await(env.DoneWithChangeWatchedFiles()) -- // Check that go.mod diagnostics picked up the newly active mod file. -- // The local version of modb has an extra dependency we need to download. -- env.OpenFile("modb/go.mod") -- env.Await(env.DoneWithOpen()) +-import "example.com/blah" - -- var d protocol.PublishDiagnosticsParams +-func main() { +- blah.Hello() +-} +-` +- WithOptions( +- ProxyFiles(workspaceProxy), +- Modes(Experimental), +- ).Run(t, mod, func(t *testing.T, env *Env) { +- params := &protocol.PublishDiagnosticsParams{} +- env.OpenFile("b/go.mod") - env.Await( - OnceMet( -- env.DiagnosticAtRegexpWithMessage("modb/go.mod", `require example.com v1.2.3`, "has not been downloaded"), -- ReadDiagnostics("modb/go.mod", &d), +- env.GoSumDiagnostic("b/go.mod", `example.com v1.2.3`), +- ReadDiagnostics("b/go.mod", params), - ), - ) -- env.ApplyQuickFixes("modb/go.mod", d.Diagnostics) -- env.Await(env.DiagnosticAtRegexp("modb/b/b.go", "x")) -- // Jumping to definition should now go to b.com in the workspace. -- if err := checkHelloLocation("modb/b/b.go"); err != nil { -- t.Fatal(err) -- } -- -- // Now, let's modify the gopls.mod *overlay* (not on disk), and verify that -- // this change is only picked up once it is saved. -- env.OpenFile("gopls.mod") -- env.Await(env.DoneWithOpen()) -- env.SetBufferContent("gopls.mod", fmt.Sprintf(`module gopls-workspace -- --require ( -- a.com v0.0.0-goplsworkspace --) -- --replace a.com => %s/moda/a --`, workdir)) -- -- // Editing the gopls.mod removes modb from the workspace modules, and so -- // should clear outstanding diagnostics... -- env.Await(OnceMet( -- env.DoneWithChange(), -- EmptyDiagnostics("modb/go.mod"), -- )) -- // ...but does not yet cause a workspace reload, so we should still jump to modb. -- if err := checkHelloLocation("modb/b/b.go"); err != nil { -- t.Fatal(err) -- } -- // Saving should reload the workspace. -- env.SaveBufferWithoutActions("gopls.mod") -- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { -- t.Fatal(err) +- for _, d := range params.Diagnostics { +- if !strings.Contains(d.Message, "go.sum is out of sync") { +- continue +- } +- actions := env.GetQuickFixes("b/go.mod", []protocol.Diagnostic{d}) +- if len(actions) != 2 { +- t.Fatalf("expected 2 code actions, got %v", len(actions)) +- } +- env.ApplyQuickFixes("b/go.mod", []protocol.Diagnostic{d}) - } +- env.Await( +- EmptyDiagnostics("b/go.mod"), +- ) - }) -} - --func TestUseGoWork(t *testing.T) { -- // This test validates certain functionality related to using a go.work -- // file to specify workspace modules. -- testenv.NeedsGo1Point(t, 14) -- const multiModule = ` ---- moda/a/go.mod -- +-// Sometimes users may have their module cache within the workspace. +-// We shouldn't consider any module in the module cache to be in the workspace. +-func TestGOMODCACHEInWorkspace(t *testing.T) { +- const mod = ` +--- a/go.mod -- -module a.com - --require b.com v1.2.3 ---- moda/a/go.sum -- --b.com v1.2.3 h1:tXrlXP0rnjRpKNmkbLYoWBdq0ikb3C3bKK9//moAWBI= --b.com v1.2.3/go.mod h1:D+J7pfFBZK5vdIdZEFquR586vKKIkqG7Qjw9AxG5BQ8= ---- moda/a/a.go -- +-go 1.12 +--- a/a.go -- -package a - --import ( -- "b.com/b" --) -- --func main() { -- var x int -- _ = b.Hello() --} ---- modb/go.mod -- --module b.com -- --require example.com v1.2.3 ---- modb/go.sum -- --example.com v1.2.3 h1:Yryq11hF02fEf2JlOS2eph+ICE2/ceevGV3C9dl5V/c= --example.com v1.2.3/go.mod h1:Y2Rc5rVWjWur0h3pd9aEvK5Pof8YKDANh9gHA2Maujo= ---- modb/b/b.go -- +-func _() {} +--- a/c/c.go -- +-package c +--- gopath/src/b/b.go -- -package b +--- gopath/pkg/mod/example.com/go.mod -- +-module example.com - --func Hello() int { -- var x int --} ---- go.work -- --go 1.17 -- --directory ( -- ./moda/a --) +-go 1.12 +--- gopath/pkg/mod/example.com/main.go -- +-package main -` - WithOptions( -- ProxyFiles(workspaceModuleProxy), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { -- // Initially, the gopls.mod should cause only the a.com module to be -- // loaded. Validate this by jumping to a definition in b.com and ensuring -- // that we go to the module cache. -- env.OpenFile("moda/a/a.go") -- env.Await(env.DoneWithOpen()) +- EditorConfig{Env: map[string]string{ +- "GOPATH": filepath.FromSlash("$SANDBOX_WORKDIR/gopath"), +- }}, +- Modes(Singleton), +- ).Run(t, mod, func(t *testing.T, env *Env) { +- env.Await( +- // Confirm that the build configuration is seen as valid, +- // even though there are technically multiple go.mod files in the +- // worskpace. +- LogMatching(protocol.Info, ".*valid build configuration = true.*", 1, false), +- ) +- }) +-} - -- // To verify which modules are loaded, we'll jump to the definition of -- // b.Hello. -- checkHelloLocation := func(want string) error { -- location, _ := env.GoToDefinition("moda/a/a.go", env.RegexpSearch("moda/a/a.go", "Hello")) -- if !strings.HasSuffix(location, want) { -- return fmt.Errorf("expected %s, got %v", want, location) -- } -- return nil -- } +-func TestAddGoWork(t *testing.T) { +- const nomod = ` +--- a/go.mod -- +-module a.com - -- // Initially this should be in the module cache, as b.com is not replaced. -- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { -- t.Fatal(err) -- } +-go 1.16 +--- a/main.go -- +-package main - -- // Now, modify the gopls.mod file on disk to activate the b.com module in -- // the workspace. -- env.WriteWorkspaceFile("go.work", ` --go 1.17 +-func main() {} +--- b/go.mod -- +-module b.com - --directory ( -- ./moda/a -- ./modb --) --`) -- env.Await(env.DoneWithChangeWatchedFiles()) -- // Check that go.mod diagnostics picked up the newly active mod file. -- // The local version of modb has an extra dependency we need to download. -- env.OpenFile("modb/go.mod") -- env.Await(env.DoneWithOpen()) +-go 1.16 +--- b/main.go -- +-package main - -- var d protocol.PublishDiagnosticsParams +-func main() {} +-` +- WithOptions( +- Modes(Singleton), +- ).Run(t, nomod, func(t *testing.T, env *Env) { +- env.OpenFile("a/main.go") +- env.OpenFile("b/main.go") - env.Await( -- OnceMet( -- env.DiagnosticAtRegexpWithMessage("modb/go.mod", `require example.com v1.2.3`, "has not been downloaded"), -- ReadDiagnostics("modb/go.mod", &d), -- ), +- DiagnosticAt("a/main.go", 0, 0), +- DiagnosticAt("b/main.go", 0, 0), - ) -- env.ApplyQuickFixes("modb/go.mod", d.Diagnostics) -- env.Await(env.DiagnosticAtRegexp("modb/b/b.go", "x")) -- // Jumping to definition should now go to b.com in the workspace. -- if err := checkHelloLocation("modb/b/b.go"); err != nil { -- t.Fatal(err) -- } -- -- // Now, let's modify the gopls.mod *overlay* (not on disk), and verify that -- // this change is only picked up once it is saved. -- env.OpenFile("go.work") -- env.Await(env.DoneWithOpen()) -- env.SetBufferContent("go.work", `go 1.17 -- --directory ( -- ./moda/a --)`) +- env.WriteWorkspaceFile("go.work", `go 1.16 - -- // Editing the gopls.mod removes modb from the workspace modules, and so -- // should clear outstanding diagnostics... -- env.Await(OnceMet( -- env.DoneWithChange(), -- EmptyDiagnostics("modb/go.mod"), -- )) -- // ...but does not yet cause a workspace reload, so we should still jump to modb. -- if err := checkHelloLocation("modb/b/b.go"); err != nil { -- t.Fatal(err) -- } -- // Saving should reload the workspace. -- env.SaveBufferWithoutActions("go.work") -- if err := checkHelloLocation("b.com@v1.2.3/b/b.go"); err != nil { -- t.Fatal(err) -- } +-use ( +- a +- b +-) +-`) +- env.Await(NoOutstandingDiagnostics()) - }) -} - --func TestNonWorkspaceFileCreation(t *testing.T) { -- testenv.NeedsGo1Point(t, 13) -- -- const files = ` +-// Tests the fix for golang/go#52500. +-func TestChangeTestVariant_Issue52500(t *testing.T) { +- // This test fails for unknown reasons at Go <= 15. Presumably the loading of +- // test variants behaves differently, possibly due to lack of support for +- // native overlays. +- testenv.NeedsGo1Point(t, 16) +- const src = ` --- go.mod -- --module mod.com +-module mod.test - -go 1.12 ---- x.go -- --package x --` +--- main_test.go -- +-package main_test - -- const code = ` --package foo --import "fmt" --var _ = fmt.Printf +-type Server struct{} +- +-const mainConst = otherConst +--- other_test.go -- +-package main_test +- +-const otherConst = 0 +- +-func (Server) Foo() {} -` -- Run(t, files, func(t *testing.T, env *Env) { -- env.CreateBuffer("/tmp/foo.go", "") -- env.EditBuffer("/tmp/foo.go", fake.NewEdit(0, 0, 0, 0, code)) -- env.GoToDefinition("/tmp/foo.go", env.RegexpSearch("/tmp/foo.go", `Printf`)) +- +- Run(t, src, func(t *testing.T, env *Env) { +- env.OpenFile("other_test.go") +- env.RegexpReplace("other_test.go", "main_test", "main") +- +- // For this test to function, it is necessary to wait on both of the +- // expectations below: the bug is that when switching the package name in +- // other_test.go from main->main_test, metadata for main_test is not marked +- // as invalid. So we need to wait for the metadata of main_test.go to be +- // updated before moving other_test.go back to the main_test package. +- env.Await( +- env.DiagnosticAtRegexpWithMessage("other_test.go", "Server", "undeclared"), +- env.DiagnosticAtRegexpWithMessage("main_test.go", "otherConst", "undeclared"), +- ) +- env.RegexpReplace("other_test.go", "main", "main_test") +- env.Await( +- EmptyDiagnostics("other_test.go"), +- EmptyDiagnostics("main_test.go"), +- ) +- +- // This will cause a test failure if other_test.go is not in any package. +- _, _ = env.GoToDefinition("other_test.go", env.RegexpSearch("other_test.go", "Server")) - }) -} +diff -urN a/gopls/internal/vulncheck/command.go b/gopls/internal/vulncheck/command.go +--- a/gopls/internal/vulncheck/command.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/vulncheck/command.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,123 +0,0 @@ +-// Copyright 2022 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. - --func TestMultiModuleV2(t *testing.T) { -- const multiModule = ` ---- moda/a/go.mod -- --module a.com +-//go:build go1.18 +-// +build go1.18 - --require b.com/v2 v2.1.9 ---- moda/a/a.go -- --package a +-package vulncheck - -import ( -- "b.com/v2/b" +- "context" +- "log" +- "os" +- "strings" +- +- "golang.org/x/tools/go/packages" +- gvc "golang.org/x/tools/gopls/internal/govulncheck" +- "golang.org/x/tools/internal/lsp/command" +- "golang.org/x/vuln/client" -) - --func main() { -- var x int -- _ = b.Hi() +-func init() { +- Govulncheck = govulncheck -} ---- modb/go.mod -- --module b.com - ---- modb/b/b.go -- --package b +-func govulncheck(ctx context.Context, cfg *packages.Config, args command.VulncheckArgs) (res command.VulncheckResult, _ error) { +- if args.Pattern == "" { +- args.Pattern = "." +- } - --func Hello() int { -- var x int --} ---- modb/v2/go.mod -- --module b.com/v2 +- dbClient, err := client.NewClient(findGOVULNDB(cfg), client.Options{HTTPCache: gvc.DefaultCache()}) +- if err != nil { +- return res, err +- } - ---- modb/v2/b/b.go -- --package b +- c := cmd{Client: dbClient} +- vulns, err := c.Run(ctx, cfg, args.Pattern) +- if err != nil { +- return res, err +- } - --func Hi() int { -- var x int +- res.Vuln = vulns +- return res, err -} ---- modc/go.mod -- --module gopkg.in/yaml.v1 // test gopkg.in versions ---- modc/main.go -- --package main - --func main() { -- var x int --} --` -- WithOptions( -- Modes(Experimental), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { -- env.Await( -- env.DiagnosticAtRegexp("moda/a/a.go", "x"), -- env.DiagnosticAtRegexp("modb/b/b.go", "x"), -- env.DiagnosticAtRegexp("modb/v2/b/b.go", "x"), -- env.DiagnosticAtRegexp("modc/main.go", "x"), -- ) -- }) +-func findGOVULNDB(cfg *packages.Config) []string { +- for _, kv := range cfg.Env { +- if strings.HasPrefix(kv, "GOVULNDB=") { +- return strings.Split(kv[len("GOVULNDB="):], ",") +- } +- } +- if GOVULNDB := os.Getenv("GOVULNDB"); GOVULNDB != "" { +- return strings.Split(GOVULNDB, ",") +- } +- return []string{"https://vuln.go.dev"} -} - --func TestWorkspaceDirAccess(t *testing.T) { -- const multiModule = ` ---- moda/a/go.mod -- --module a.com -- --go 1.15 ---- moda/a/a.go -- --package main +-type Vuln = command.Vuln +-type CallStack = command.CallStack +-type StackEntry = command.StackEntry - --func main() { -- fmt.Println("Hello") +-// cmd is an in-process govulncheck command runner +-// that uses the provided client.Client. +-type cmd struct { +- Client client.Client -} ---- modb/go.mod -- --module b.com - --go 1.16 ---- modb/b/b.go -- --package main +-// Run runs the govulncheck after loading packages using the provided packages.Config. +-func (c *cmd) Run(ctx context.Context, cfg *packages.Config, patterns ...string) (_ []Vuln, err error) { +- cfg.Mode |= packages.NeedModule | packages.NeedName | packages.NeedFiles | +- packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedTypes | +- packages.NeedTypesSizes | packages.NeedSyntax | packages.NeedTypesInfo | packages.NeedDeps - --func main() { -- fmt.Println("World") +- log.Println("loading packages...") +- loadedPkgs, err := gvc.LoadPackages(cfg, patterns...) +- if err != nil { +- log.Printf("package load failed: %v", err) +- return nil, err +- } +- log.Printf("loaded %d packages\n", len(loadedPkgs)) +- +- r, err := gvc.Source(ctx, loadedPkgs, c.Client) +- if err != nil { +- return nil, err +- } +- callInfo := gvc.GetCallInfo(r, loadedPkgs) +- return toVulns(callInfo) +- // TODO: add import graphs. -} --` -- WithOptions( -- Modes(Experimental), -- SendPID(), -- ).Run(t, multiModule, func(t *testing.T, env *Env) { -- params := &protocol.ExecuteCommandParams{ -- Command: command.WorkspaceMetadata.ID(), -- Arguments: []json.RawMessage{json.RawMessage("{}")}, -- } -- var result command.WorkspaceMetadataResult -- env.ExecuteCommand(params, &result) - -- if n := len(result.Workspaces); n != 1 { -- env.T.Fatalf("got %d workspaces, want 1", n) +-func toVulns(ci *gvc.CallInfo) ([]Vuln, error) { +- var vulns []Vuln +- +- for _, vg := range ci.VulnGroups { +- v0 := vg[0] +- lf := gvc.LatestFixed(v0.OSV.Affected) +- if lf != "" && lf[0] != 'v' { +- lf = "v" + lf - } -- // Don't factor this out of Server.addFolders. vscode-go expects this -- // directory. -- modPath := filepath.Join(result.Workspaces[0].ModuleDir, "go.mod") -- gotb, err := ioutil.ReadFile(modPath) -- if err != nil { -- t.Fatalf("reading expected workspace modfile: %v", err) +- vuln := Vuln{ +- ID: v0.OSV.ID, +- PkgPath: v0.PkgPath, +- CurrentVersion: ci.ModuleVersions[v0.ModPath], +- FixedVersion: lf, +- Details: v0.OSV.Details, +- +- Aliases: v0.OSV.Aliases, +- Symbol: v0.Symbol, +- ModPath: v0.ModPath, +- URL: href(v0.OSV), - } -- got := string(gotb) -- for _, want := range []string{"go 1.16", "a.com v1.9999999.0-goplsworkspace", "b.com v1.9999999.0-goplsworkspace"} { -- if !strings.Contains(got, want) { -- // want before got here, since the go.mod is multi-line -- t.Fatalf("workspace go.mod missing %q. got:\n%s", want, got) +- +- // Keep first call stack for each vuln. +- for _, v := range vg { +- if css := ci.CallStacks[v]; len(css) > 0 { +- vuln.CallStacks = append(vuln.CallStacks, toCallStack(css[0])) +- vuln.CallStackSummaries = append(vuln.CallStackSummaries, gvc.SummarizeCallStack(css[0], ci.TopPackages, v.PkgPath)) - } - } -- workdir := env.Sandbox.Workdir.RootURI().SpanURI().Filename() -- env.WriteWorkspaceFile("gopls.mod", fmt.Sprintf(` -- module gopls-workspace +- vulns = append(vulns, vuln) +- } +- return vulns, nil +-} +diff -urN a/gopls/internal/vulncheck/command_test.go b/gopls/internal/vulncheck/command_test.go +--- a/gopls/internal/vulncheck/command_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/vulncheck/command_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,310 +0,0 @@ +-// Copyright 2022 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. - -- require ( -- a.com v1.9999999.0-goplsworkspace -- ) +-//go:build go1.18 +-// +build go1.18 - -- replace a.com => %s/moda/a -- `, workdir)) -- env.Await(env.DoneWithChangeWatchedFiles()) -- gotb, err = ioutil.ReadFile(modPath) +-package vulncheck +- +-import ( +- "bytes" +- "context" +- "fmt" +- "os" +- "path/filepath" +- "sort" +- "testing" +- +- "github.com/google/go-cmp/cmp" +- "github.com/google/go-cmp/cmp/cmpopts" +- "golang.org/x/tools/go/packages" +- "golang.org/x/tools/internal/lsp/cache" +- "golang.org/x/tools/internal/lsp/fake" +- "golang.org/x/tools/internal/lsp/source" +- "golang.org/x/tools/internal/lsp/tests" +- "golang.org/x/vuln/client" +- "golang.org/x/vuln/osv" +-) +- +-func TestCmd_Run(t *testing.T) { +- runTest(t, workspace1, proxy1, func(ctx context.Context, snapshot source.Snapshot) { +- cmd := &cmd{Client: testClient1} +- cfg := packagesCfg(ctx, snapshot) +- result, err := cmd.Run(ctx, cfg, "./...") - if err != nil { -- t.Fatalf("reading expected workspace modfile: %v", err) +- t.Fatal(err) +- } +- // Check that we find the right number of vulnerabilities. +- // There should be three entries as there are three vulnerable +- // symbols in the two import-reachable OSVs. +- var got []report +- for _, v := range result { +- got = append(got, toReport(v)) +- } +- +- var want = []report{ +- { +- Vuln: Vuln{ +- ID: "GO-2022-01", +- Symbol: "VulnData.Vuln1", +- PkgPath: "golang.org/amod/avuln", +- ModPath: "golang.org/amod", +- URL: "https://pkg.go.dev/vuln/GO-2022-01", +- CurrentVersion: "v1.1.3", +- FixedVersion: "v1.0.4", +- CallStackSummaries: []string{ +- "golang.org/entry/x.X calls golang.org/amod/avuln.VulnData.Vuln1", +- "golang.org/entry/x.X calls golang.org/cmod/c.C1, which eventually calls golang.org/amod/avuln.VulnData.Vuln2", +- }, +- }, +- CallStacksStr: []string{ +- "golang.org/entry/x.X [approx.] (x.go:8)\n" + +- "golang.org/amod/avuln.VulnData.Vuln1 (avuln.go:3)\n", +- "golang.org/entry/x.X (x.go:8)\n" + +- "golang.org/cmod/c.C1 (c.go:13)\n" + +- "golang.org/amod/avuln.VulnData.Vuln2 (avuln.go:4)\n", +- }, +- }, +- { +- Vuln: Vuln{ +- ID: "GO-2022-02", +- Symbol: "Vuln", +- PkgPath: "golang.org/bmod/bvuln", +- ModPath: "golang.org/bmod", +- URL: "https://pkg.go.dev/vuln/GO-2022-02", +- CurrentVersion: "v0.5.0", +- CallStackSummaries: []string{"golang.org/entry/y.Y calls golang.org/bmod/bvuln.Vuln"}, +- }, +- CallStacksStr: []string{ +- "golang.org/entry/y.Y [approx.] (y.go:5)\n" + +- "golang.org/bmod/bvuln.Vuln (bvuln.go:2)\n", +- }, +- }, +- } +- // sort reports for stability before comparison. +- for _, rpts := range [][]report{got, want} { +- sort.Slice(rpts, func(i, j int) bool { +- a, b := rpts[i], rpts[j] +- if a.ID != b.ID { +- return a.ID < b.ID +- } +- if a.PkgPath != b.PkgPath { +- return a.PkgPath < b.PkgPath +- } +- return a.Symbol < b.Symbol +- }) - } -- got = string(gotb) -- want := "b.com v1.9999999.0-goplsworkspace" -- if strings.Contains(got, want) { -- t.Fatalf("workspace go.mod contains unexpected %q. got:\n%s", want, got) +- if diff := cmp.Diff(want, got, cmpopts.IgnoreFields(report{}, "Vuln.CallStacks")); diff != "" { +- t.Error(diff) - } +- - }) -} - --func TestDirectoryFiltersLoads(t *testing.T) { -- // exclude, and its error, should be excluded from the workspace. -- const files = ` ---- go.mod -- --module example.com -- --go 1.12 ---- exclude/exclude.go -- --package exclude +-type report struct { +- Vuln +- // Trace is stringified Vuln.CallStacks +- CallStacksStr []string +-} - --const _ = Nonexistant --` -- cfg := EditorConfig{ -- DirectoryFilters: []string{"-exclude"}, +-func toReport(v Vuln) report { +- var r = report{Vuln: v} +- for _, s := range v.CallStacks { +- r.CallStacksStr = append(r.CallStacksStr, CallStackString(s)) - } -- WithOptions(cfg).Run(t, files, func(t *testing.T, env *Env) { -- env.Await(NoDiagnostics("exclude/x.go")) -- }) +- return r -} - --func TestDirectoryFiltersTransitiveDep(t *testing.T) { -- // Even though exclude is excluded from the workspace, it should -- // still be importable as a non-workspace package. -- const files = ` +-func CallStackString(callstack CallStack) string { +- var b bytes.Buffer +- for _, entry := range callstack { +- fname := filepath.Base(entry.URI.SpanURI().Filename()) +- fmt.Fprintf(&b, "%v (%v:%d)\n", entry.Name, fname, entry.Pos.Line) +- } +- return b.String() +-} +- +-const workspace1 = ` --- go.mod -- --module example.com +-module golang.org/entry - --go 1.12 ---- include/include.go -- --package include --import "example.com/exclude" +-require ( +- golang.org/cmod v1.1.3 +-) +-go 1.18 +--- x/x.go -- +-package x - --const _ = exclude.X ---- exclude/exclude.go -- --package exclude +-import ( +- "golang.org/cmod/c" +- "golang.org/entry/y" +-) - --const _ = Nonexistant // should be ignored, since this is a non-workspace package --const X = 1 --` +-func X() { +- c.C1().Vuln1() // vuln use: X -> Vuln1 +-} - -- cfg := EditorConfig{ -- DirectoryFilters: []string{"-exclude"}, -- } -- WithOptions(cfg).Run(t, files, func(t *testing.T, env *Env) { -- env.Await( -- NoDiagnostics("exclude/exclude.go"), // filtered out -- NoDiagnostics("include/include.go"), // successfully builds -- ) -- }) +-func CallY() { +- y.Y() // vuln use: CallY -> y.Y -> bvuln.Vuln -} - --func TestDirectoryFiltersWorkspaceModules(t *testing.T) { -- // Define a module include.com which should be in the workspace, plus a -- // module exclude.com which should be excluded and therefore come from -- // the proxy. -- const files = ` ---- include/go.mod -- --module include.com +--- y/y.go -- +-package y +- +-import "golang.org/cmod/c" +- +-func Y() { +- c.C2()() // vuln use: Y -> bvuln.Vuln +-} +-` +- +-const proxy1 = ` +--- golang.org/cmod@v1.1.3/go.mod -- +-module golang.org/cmod - -go 1.12 +--- golang.org/cmod@v1.1.3/c/c.go -- +-package c - --require exclude.com v1.0.0 +-import ( +- "golang.org/amod/avuln" +- "golang.org/bmod/bvuln" +-) - ---- include/go.sum -- --exclude.com v1.0.0 h1:Q5QSfDXY5qyNCBeUiWovUGqcLCRZKoTs9XdBeVz+w1I= --exclude.com v1.0.0/go.mod h1:hFox2uDlNB2s2Jfd9tHlQVfgqUiLVTmh6ZKat4cvnj4= +-type I interface { +- Vuln1() +-} - ---- include/include.go -- --package include +-func C1() I { +- v := avuln.VulnData{} +- v.Vuln2() // vuln use +- return v +-} - --import "exclude.com" +-func C2() func() { +- return bvuln.Vuln +-} +--- golang.org/amod@v1.1.3/go.mod -- +-module golang.org/amod - --var _ = exclude.X // satisfied only by the workspace version ---- exclude/go.mod -- --module exclude.com +-go 1.14 +--- golang.org/amod@v1.1.3/avuln/avuln.go -- +-package avuln - --go 1.12 ---- exclude/exclude.go -- --package exclude +-type VulnData struct {} +-func (v VulnData) Vuln1() {} +-func (v VulnData) Vuln2() {} +--- golang.org/bmod@v0.5.0/go.mod -- +-module golang.org/bmod - --const X = 1 --` -- const proxy = ` ---- exclude.com@v1.0.0/go.mod -- --module exclude.com +-go 1.14 +--- golang.org/bmod@v0.5.0/bvuln/bvuln.go -- +-package bvuln - --go 1.12 ---- exclude.com@v1.0.0/exclude.go -- --package exclude +-func Vuln() { +- // something evil +-} -` -- cfg := EditorConfig{ -- DirectoryFilters: []string{"-exclude"}, -- } -- WithOptions(cfg, Modes(Experimental), ProxyFiles(proxy)).Run(t, files, func(t *testing.T, env *Env) { -- env.Await(env.DiagnosticAtRegexp("include/include.go", `exclude.(X)`)) -- }) +- +-// testClient contains the following test vulnerabilities +-// +-// golang.org/amod/avuln.{VulnData.Vuln1, vulnData.Vuln2} +-// golang.org/bmod/bvuln.{Vuln} +-var testClient1 = &mockClient{ +- ret: map[string][]*osv.Entry{ +- "golang.org/amod": { +- { +- ID: "GO-2022-01", +- References: []osv.Reference{ +- { +- Type: "href", +- URL: "pkg.go.dev/vuln/GO-2022-01", +- }, +- }, +- Affected: []osv.Affected{{ +- Package: osv.Package{Name: "golang.org/amod/avuln"}, +- Ranges: osv.Affects{{Type: osv.TypeSemver, Events: []osv.RangeEvent{{Introduced: "1.0.0"}, {Fixed: "1.0.4"}, {Introduced: "1.1.2"}}}}, +- EcosystemSpecific: osv.EcosystemSpecific{Symbols: []string{"VulnData.Vuln1", "VulnData.Vuln2"}}, +- }}, +- }, +- }, +- "golang.org/bmod": { +- { +- ID: "GO-2022-02", +- Affected: []osv.Affected{{ +- Package: osv.Package{Name: "golang.org/bmod/bvuln"}, +- Ranges: osv.Affects{{Type: osv.TypeSemver}}, +- EcosystemSpecific: osv.EcosystemSpecific{Symbols: []string{"Vuln"}}, +- }}, +- }, +- }, +- }, -} - --// Confirm that a fix for a tidy module will correct all modules in the --// workspace. --func TestMultiModule_OneBrokenModule(t *testing.T) { -- testenv.NeedsGo1Point(t, 15) +-type mockClient struct { +- client.Client +- ret map[string][]*osv.Entry +-} - -- const mod = ` ---- a/go.mod -- --module a.com +-func (mc *mockClient) GetByModule(ctx context.Context, a string) ([]*osv.Entry, error) { +- return mc.ret[a], nil +-} - --go 1.12 ---- a/main.go -- --package main ---- b/go.mod -- --module b.com +-func runTest(t *testing.T, workspaceData, proxyData string, test func(context.Context, source.Snapshot)) { +- ws, err := fake.NewSandbox(&fake.SandboxConfig{ +- Files: fake.UnpackTxt(workspaceData), +- ProxyFiles: fake.UnpackTxt(proxyData), +- }) +- if err != nil { +- t.Fatal(err) +- } +- defer ws.Close() - --go 1.12 +- ctx := tests.Context(t) - --require ( -- example.com v1.2.3 --) ---- b/go.sum -- ---- b/main.go -- --package b +- // get the module cache populated and the go.sum file at the root auto-generated. +- dir := ws.Workdir.RootURI().SpanURI().Filename() +- if err := ws.RunGoCommand(ctx, dir, "list", []string{"-mod=mod", "..."}, true); err != nil { +- t.Fatal(err) +- } - --import "example.com/blah" +- cache := cache.New(nil) +- session := cache.NewSession(ctx) +- options := source.DefaultOptions().Clone() +- tests.DefaultOptions(options) +- session.SetOptions(options) +- envs := []string{} +- for k, v := range ws.GoEnv() { +- envs = append(envs, k+"="+v) +- } +- options.SetEnvSlice(envs) +- name := ws.RootDir() +- folder := ws.Workdir.RootURI().SpanURI() +- view, snapshot, release, err := session.NewView(ctx, name, folder, options) +- if err != nil { +- t.Fatal(err) +- } +- defer release() +- defer view.Shutdown(ctx) - --func main() { -- blah.Hello() +- test(ctx, snapshot) -} --` -- WithOptions( -- ProxyFiles(workspaceProxy), -- Modes(Experimental), -- ).Run(t, mod, func(t *testing.T, env *Env) { -- params := &protocol.PublishDiagnosticsParams{} -- env.OpenFile("b/go.mod") -- env.Await( -- OnceMet( -- env.GoSumDiagnostic("b/go.mod", `example.com v1.2.3`), -- ReadDiagnostics("b/go.mod", params), -- ), -- ) -- for _, d := range params.Diagnostics { -- if !strings.Contains(d.Message, "go.sum is out of sync") { -- continue -- } -- actions := env.GetQuickFixes("b/go.mod", []protocol.Diagnostic{d}) -- if len(actions) != 2 { -- t.Fatalf("expected 2 code actions, got %v", len(actions)) -- } -- env.ApplyQuickFixes("b/go.mod", []protocol.Diagnostic{d}) -- } -- env.Await( -- EmptyDiagnostics("b/go.mod"), -- ) -- }) +- +-// TODO: expose this as a method of Snapshot. +-func packagesCfg(ctx context.Context, snapshot source.Snapshot) *packages.Config { +- view := snapshot.View() +- viewBuildFlags := view.Options().BuildFlags +- var viewEnv []string +- if e := view.Options().EnvSlice(); e != nil { +- viewEnv = append(os.Environ(), e...) +- } +- return &packages.Config{ +- // Mode will be set by cmd.Run. +- Context: ctx, +- Tests: true, +- BuildFlags: viewBuildFlags, +- Env: viewEnv, +- Dir: view.Folder().Filename(), +- } -} +diff -urN a/gopls/internal/vulncheck/util.go b/gopls/internal/vulncheck/util.go +--- a/gopls/internal/vulncheck/util.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/vulncheck/util.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,82 +0,0 @@ +-// Copyright 2022 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. - --// Sometimes users may have their module cache within the workspace. --// We shouldn't consider any module in the module cache to be in the workspace. --func TestGOMODCACHEInWorkspace(t *testing.T) { -- const mod = ` ---- a/go.mod -- --module a.com +-//go:build go1.18 +-// +build go1.18 - --go 1.12 ---- a/a.go -- --package a +-package vulncheck - --func _() {} ---- a/c/c.go -- --package c ---- gopath/src/b/b.go -- --package b ---- gopath/pkg/mod/example.com/go.mod -- --module example.com +-import ( +- "fmt" +- "go/token" - --go 1.12 ---- gopath/pkg/mod/example.com/main.go -- --package main --` -- WithOptions( -- EditorConfig{Env: map[string]string{ -- "GOPATH": filepath.FromSlash("$SANDBOX_WORKDIR/gopath"), -- }}, -- Modes(Singleton), -- ).Run(t, mod, func(t *testing.T, env *Env) { -- env.Await( -- // Confirm that the build configuration is seen as valid, -- // even though there are technically multiple go.mod files in the -- // worskpace. -- LogMatching(protocol.Info, ".*valid build configuration = true.*", 1, false), -- ) -- }) +- gvc "golang.org/x/tools/gopls/internal/govulncheck" +- "golang.org/x/tools/internal/lsp/protocol" +- "golang.org/x/vuln/osv" +- "golang.org/x/vuln/vulncheck" +-) +- +-func toCallStack(src vulncheck.CallStack) CallStack { +- var dest []StackEntry +- for _, e := range src { +- dest = append(dest, toStackEntry(e)) +- } +- return dest -} - --func TestAddGoWork(t *testing.T) { -- const nomod = ` ---- a/go.mod -- --module a.com +-func toStackEntry(src vulncheck.StackEntry) StackEntry { +- f, call := src.Function, src.Call +- pos := f.Pos +- desc := gvc.FuncName(f) +- if src.Call != nil { +- pos = src.Call.Pos // Exact call site position is helpful. +- if !call.Resolved { +- // In case of a statically unresolved call site, communicate to the client +- // that this was approximately resolved to f - --go 1.16 ---- a/main.go -- --package main +- desc += " [approx.]" +- } +- } +- return StackEntry{ +- Name: desc, +- URI: filenameToURI(pos), +- Pos: posToPosition(pos), +- } +-} - --func main() {} ---- b/go.mod -- --module b.com +-// href returns a URL embedded in the entry if any. +-// If no suitable URL is found, it returns a default entry in +-// pkg.go.dev/vuln. +-func href(vuln *osv.Entry) string { +- for _, affected := range vuln.Affected { +- if url := affected.DatabaseSpecific.URL; url != "" { +- return url +- } +- } +- for _, r := range vuln.References { +- if r.Type == "WEB" { +- return r.URL +- } +- } +- return fmt.Sprintf("https://pkg.go.dev/vuln/%s", vuln.ID) +-} - --go 1.16 ---- b/main.go -- --package main +-func filenameToURI(pos *token.Position) protocol.DocumentURI { +- if pos == nil || pos.Filename == "" { +- return "" +- } +- return protocol.URIFromPath(pos.Filename) +-} - --func main() {} --` -- WithOptions( -- Modes(Singleton), -- ).Run(t, nomod, func(t *testing.T, env *Env) { -- env.OpenFile("a/main.go") -- env.OpenFile("b/main.go") -- env.Await( -- DiagnosticAt("a/main.go", 0, 0), -- DiagnosticAt("b/main.go", 0, 0), -- ) -- env.WriteWorkspaceFile("go.work", `go 1.16 +-func posToPosition(pos *token.Position) (p protocol.Position) { +- // token.Position.Line starts from 1, and +- // LSP protocol's position line is 0-based. +- if pos != nil { +- p.Line = uint32(pos.Line - 1) +- // TODO(hyangah): LSP uses UTF16 column. +- // We need utility like span.ToUTF16Column, +- // but somthing that does not require file contents. +- } +- return p +-} +diff -urN a/gopls/internal/vulncheck/vulncheck.go b/gopls/internal/vulncheck/vulncheck.go +--- a/gopls/internal/vulncheck/vulncheck.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/internal/vulncheck/vulncheck.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,23 +0,0 @@ +-// Copyright 2022 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. - --directory ( -- a -- b +-// Package vulncheck provides an analysis command +-// that runs vulnerability analysis using data from +-// golang.org/x/vuln/vulncheck. +-// This package requires go1.18 or newer. +-package vulncheck +- +-import ( +- "context" +- "errors" +- +- "golang.org/x/tools/go/packages" +- "golang.org/x/tools/internal/lsp/command" -) --`) -- env.Await( -- EmptyDiagnostics("a/main.go"), -- EmptyDiagnostics("b/main.go"), -- ) -- }) +- +-// Govulncheck runs the in-process govulncheck implementation. +-// With go1.18+, this is swapped with the real implementation. +-var Govulncheck = func(ctx context.Context, cfg *packages.Config, args command.VulncheckArgs) (res command.VulncheckResult, _ error) { +- return res, errors.New("not implemented") -} diff -urN a/gopls/main.go b/gopls/main.go ---- a/gopls/main.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/main.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,26 +0,0 @@ +--- a/gopls/main.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/main.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,31 +0,0 @@ -// Copyright 2019 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. @@ -15189,6 +17735,7 @@ diff -urN a/gopls/main.go b/gopls/main.go - -import ( - "context" +- "golang.org/x/tools/internal/analysisinternal" - "os" - - "golang.org/x/tools/gopls/internal/hooks" @@ -15197,12 +17744,16 @@ diff -urN a/gopls/main.go b/gopls/main.go -) - -func main() { +- // In 1.18, diagnostics for Fuzz tests must not be used by cmd/vet. +- // So the code for Fuzz tests diagnostics is guarded behind flag analysisinternal.DiagnoseFuzzTests +- // Turn on analysisinternal.DiagnoseFuzzTests for gopls +- analysisinternal.DiagnoseFuzzTests = true - ctx := context.Background() - tool.Main(ctx, cmd.New("gopls", "", nil, hooks.Options), os.Args[1:]) -} diff -urN a/gopls/release/release.go b/gopls/release/release.go ---- a/gopls/release/release.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/release/release.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/release/release.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/release/release.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,213 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -15418,8 +17969,8 @@ diff -urN a/gopls/release/release.go b/gopls/release/release.go - return nil -} diff -urN a/gopls/test/debug/debug_test.go b/gopls/test/debug/debug_test.go ---- a/gopls/test/debug/debug_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/test/debug/debug_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/test/debug/debug_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/test/debug/debug_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,181 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style @@ -15603,9 +18154,9 @@ diff -urN a/gopls/test/debug/debug_test.go b/gopls/test/debug/debug_test.go - return nil -} diff -urN a/gopls/test/gopls_test.go b/gopls/test/gopls_test.go ---- a/gopls/test/gopls_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/test/gopls_test.go 1969-12-31 16:00:00.000000000 -0800 -@@ -1,32 +0,0 @@ +--- a/gopls/test/gopls_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/test/gopls_test.go 1970-01-01 01:00:00.000000000 +0100 +@@ -1,34 +0,0 @@ -// Copyright 2019 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. @@ -15617,6 +18168,7 @@ diff -urN a/gopls/test/gopls_test.go b/gopls/test/gopls_test.go - "testing" - - "golang.org/x/tools/gopls/internal/hooks" +- "golang.org/x/tools/internal/lsp/bug" - cmdtest "golang.org/x/tools/internal/lsp/cmd/test" - "golang.org/x/tools/internal/lsp/source" - "golang.org/x/tools/internal/lsp/tests" @@ -15624,6 +18176,7 @@ diff -urN a/gopls/test/gopls_test.go b/gopls/test/gopls_test.go -) - -func TestMain(m *testing.M) { +- bug.PanicOnBugs = true - testenv.ExitIfSmallMachine() - os.Exit(m.Run()) -} @@ -15639,8 +18192,8 @@ diff -urN a/gopls/test/gopls_test.go b/gopls/test/gopls_test.go - hooks.Options(options) -} diff -urN a/gopls/test/json_test.go b/gopls/test/json_test.go ---- a/gopls/test/json_test.go 2022-03-14 16:31:30.000000000 -0700 -+++ b/gopls/test/json_test.go 1969-12-31 16:00:00.000000000 -0800 +--- a/gopls/test/json_test.go 2000-01-01 00:00:00.000000000 -0000 ++++ b/gopls/test/json_test.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,134 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style diff --git a/third_party/org_golang_x_tools-gazelle.patch b/third_party/org_golang_x_tools-gazelle.patch index 0a7a4f8de8..6fe5cbd3c1 100644 --- a/third_party/org_golang_x_tools-gazelle.patch +++ b/third_party/org_golang_x_tools-gazelle.patch @@ -1,5 +1,5 @@ diff -urN b/benchmark/parse/BUILD.bazel c/benchmark/parse/BUILD.bazel ---- b/benchmark/parse/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/benchmark/parse/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/benchmark/parse/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -23,7 +23,7 @@ diff -urN b/benchmark/parse/BUILD.bazel c/benchmark/parse/BUILD.bazel + embed = [":parse"], +) diff -urN b/blog/BUILD.bazel c/blog/BUILD.bazel ---- b/blog/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/blog/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/blog/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -51,7 +51,7 @@ diff -urN b/blog/BUILD.bazel c/blog/BUILD.bazel + embed = [":blog"], +) diff -urN b/blog/atom/BUILD.bazel c/blog/atom/BUILD.bazel ---- b/blog/atom/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/blog/atom/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/blog/atom/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -69,7 +69,7 @@ diff -urN b/blog/atom/BUILD.bazel c/blog/atom/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/auth/authtest/BUILD.bazel c/cmd/auth/authtest/BUILD.bazel ---- b/cmd/auth/authtest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/auth/authtest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/auth/authtest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -88,7 +88,7 @@ diff -urN b/cmd/auth/authtest/BUILD.bazel c/cmd/auth/authtest/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/auth/cookieauth/BUILD.bazel c/cmd/auth/cookieauth/BUILD.bazel ---- b/cmd/auth/cookieauth/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/auth/cookieauth/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/auth/cookieauth/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -106,7 +106,7 @@ diff -urN b/cmd/auth/cookieauth/BUILD.bazel c/cmd/auth/cookieauth/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/auth/gitauth/BUILD.bazel c/cmd/auth/gitauth/BUILD.bazel ---- b/cmd/auth/gitauth/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/auth/gitauth/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/auth/gitauth/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -125,7 +125,7 @@ diff -urN b/cmd/auth/gitauth/BUILD.bazel c/cmd/auth/gitauth/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/auth/netrcauth/BUILD.bazel c/cmd/auth/netrcauth/BUILD.bazel ---- b/cmd/auth/netrcauth/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/auth/netrcauth/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/auth/netrcauth/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -143,7 +143,7 @@ diff -urN b/cmd/auth/netrcauth/BUILD.bazel c/cmd/auth/netrcauth/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/benchcmp/BUILD.bazel c/cmd/benchcmp/BUILD.bazel ---- b/cmd/benchcmp/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/benchcmp/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/benchcmp/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -176,9 +176,9 @@ diff -urN b/cmd/benchcmp/BUILD.bazel c/cmd/benchcmp/BUILD.bazel + deps = ["//benchmark/parse"], +) diff -urN b/cmd/bundle/BUILD.bazel c/cmd/bundle/BUILD.bazel ---- b/cmd/bundle/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/bundle/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/bundle/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,22 @@ +@@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( @@ -198,11 +198,12 @@ diff -urN b/cmd/bundle/BUILD.bazel c/cmd/bundle/BUILD.bazel +go_test( + name = "bundle_test", + srcs = ["main_test.go"], ++ data = glob(["testdata/**"]), + embed = [":bundle_lib"], + deps = ["//go/packages/packagestest"], +) diff -urN b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel c/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel ---- b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -220,7 +221,7 @@ diff -urN b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel c/cmd/bun + visibility = ["//visibility:public"], +) diff -urN b/cmd/bundle/testdata/src/initial/BUILD.bazel c/cmd/bundle/testdata/src/initial/BUILD.bazel ---- b/cmd/bundle/testdata/src/initial/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/bundle/testdata/src/initial/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/bundle/testdata/src/initial/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -242,9 +243,9 @@ diff -urN b/cmd/bundle/testdata/src/initial/BUILD.bazel c/cmd/bundle/testdata/sr + visibility = ["//visibility:public"], +) diff -urN b/cmd/callgraph/BUILD.bazel c/cmd/callgraph/BUILD.bazel ---- b/cmd/callgraph/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/callgraph/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/callgraph/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,73 @@ +@@ -0,0 +1,75 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( @@ -258,6 +259,7 @@ diff -urN b/cmd/callgraph/BUILD.bazel c/cmd/callgraph/BUILD.bazel + "//go/callgraph/cha", + "//go/callgraph/rta", + "//go/callgraph/static", ++ "//go/callgraph/vta", + "//go/packages", + "//go/pointer", + "//go/ssa", @@ -274,6 +276,7 @@ diff -urN b/cmd/callgraph/BUILD.bazel c/cmd/callgraph/BUILD.bazel +go_test( + name = "callgraph_test", + srcs = ["main_test.go"], ++ data = glob(["testdata/**"]), + embed = [":callgraph_lib"], + deps = select({ + "@io_bazel_rules_go//go/platform:aix": [ @@ -319,7 +322,7 @@ diff -urN b/cmd/callgraph/BUILD.bazel c/cmd/callgraph/BUILD.bazel + }), +) diff -urN b/cmd/callgraph/testdata/src/pkg/BUILD.bazel c/cmd/callgraph/testdata/src/pkg/BUILD.bazel ---- b/cmd/callgraph/testdata/src/pkg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/callgraph/testdata/src/pkg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/callgraph/testdata/src/pkg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -343,7 +346,7 @@ diff -urN b/cmd/callgraph/testdata/src/pkg/BUILD.bazel c/cmd/callgraph/testdata/ + embed = [":pkg_lib"], +) diff -urN b/cmd/compilebench/BUILD.bazel c/cmd/compilebench/BUILD.bazel ---- b/cmd/compilebench/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/compilebench/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/compilebench/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -362,7 +365,7 @@ diff -urN b/cmd/compilebench/BUILD.bazel c/cmd/compilebench/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/cover/BUILD.bazel c/cmd/cover/BUILD.bazel ---- b/cmd/cover/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/cover/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/cover/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,70 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -436,7 +439,7 @@ diff -urN b/cmd/cover/BUILD.bazel c/cmd/cover/BUILD.bazel + }), +) diff -urN b/cmd/cover/testdata/BUILD.bazel c/cmd/cover/testdata/BUILD.bazel ---- b/cmd/cover/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/cover/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/cover/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -457,7 +460,7 @@ diff -urN b/cmd/cover/testdata/BUILD.bazel c/cmd/cover/testdata/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/digraph/BUILD.bazel c/cmd/digraph/BUILD.bazel ---- b/cmd/digraph/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/digraph/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/digraph/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -481,7 +484,7 @@ diff -urN b/cmd/digraph/BUILD.bazel c/cmd/digraph/BUILD.bazel + embed = [":digraph_lib"], +) diff -urN b/cmd/eg/BUILD.bazel c/cmd/eg/BUILD.bazel ---- b/cmd/eg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/eg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/eg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -504,7 +507,7 @@ diff -urN b/cmd/eg/BUILD.bazel c/cmd/eg/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/file2fuzz/BUILD.bazel c/cmd/file2fuzz/BUILD.bazel ---- b/cmd/file2fuzz/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/file2fuzz/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/file2fuzz/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -528,9 +531,9 @@ diff -urN b/cmd/file2fuzz/BUILD.bazel c/cmd/file2fuzz/BUILD.bazel + embed = [":file2fuzz_lib"], +) diff -urN b/cmd/fiximports/BUILD.bazel c/cmd/fiximports/BUILD.bazel ---- b/cmd/fiximports/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,63 @@ +@@ -0,0 +1,64 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( @@ -550,6 +553,7 @@ diff -urN b/cmd/fiximports/BUILD.bazel c/cmd/fiximports/BUILD.bazel +go_test( + name = "fiximports_test", + srcs = ["main_test.go"], ++ data = glob(["testdata/**"]), + embed = [":fiximports_lib"], + deps = select({ + "@io_bazel_rules_go//go/platform:aix": [ @@ -595,7 +599,7 @@ diff -urN b/cmd/fiximports/BUILD.bazel c/cmd/fiximports/BUILD.bazel + }), +) diff -urN b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel ---- b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -613,7 +617,7 @@ diff -urN b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel c/cmd/fiximp + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel ---- b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -631,7 +635,7 @@ diff -urN b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel c/cmd/fiximp + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel ---- b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -649,7 +653,7 @@ diff -urN b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel c/cmd/fiximpor + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel c/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel ---- b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -667,7 +671,7 @@ diff -urN b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel c/cmd/fiximports + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel c/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel ---- b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -685,7 +689,7 @@ diff -urN b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel c/cmd/fiximports + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel c/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel ---- b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -703,7 +707,7 @@ diff -urN b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel c/cmd/fiximports + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel c/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel ---- b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -721,7 +725,7 @@ diff -urN b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel c/cmd/fiximp + visibility = ["//visibility:public"], +) diff -urN b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel c/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel ---- b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -739,7 +743,7 @@ diff -urN b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel c/cmd/fiximp + visibility = ["//visibility:public"], +) diff -urN b/cmd/getgo/BUILD.bazel c/cmd/getgo/BUILD.bazel ---- b/cmd/getgo/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/getgo/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/getgo/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,74 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -817,7 +821,7 @@ diff -urN b/cmd/getgo/BUILD.bazel c/cmd/getgo/BUILD.bazel + embed = [":getgo_lib"], +) diff -urN b/cmd/getgo/server/BUILD.bazel c/cmd/getgo/server/BUILD.bazel ---- b/cmd/getgo/server/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/getgo/server/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/getgo/server/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -835,7 +839,7 @@ diff -urN b/cmd/getgo/server/BUILD.bazel c/cmd/getgo/server/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/go-contrib-init/BUILD.bazel c/cmd/go-contrib-init/BUILD.bazel ---- b/cmd/go-contrib-init/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/go-contrib-init/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/go-contrib-init/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -860,7 +864,7 @@ diff -urN b/cmd/go-contrib-init/BUILD.bazel c/cmd/go-contrib-init/BUILD.bazel + embed = [":go-contrib-init_lib"], +) diff -urN b/cmd/godex/BUILD.bazel c/cmd/godex/BUILD.bazel ---- b/cmd/godex/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/godex/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/godex/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -888,9 +892,9 @@ diff -urN b/cmd/godex/BUILD.bazel c/cmd/godex/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/godoc/BUILD.bazel c/cmd/godoc/BUILD.bazel ---- b/cmd/godoc/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/godoc/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/godoc/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,41 @@ +@@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( @@ -914,7 +918,6 @@ diff -urN b/cmd/godoc/BUILD.bazel c/cmd/godoc/BUILD.bazel + "//internal/gocommand", + "//playground", + "@org_golang_x_sys//execabs:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -933,7 +936,7 @@ diff -urN b/cmd/godoc/BUILD.bazel c/cmd/godoc/BUILD.bazel + ], +) diff -urN b/cmd/goimports/BUILD.bazel c/cmd/goimports/BUILD.bazel ---- b/cmd/goimports/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/goimports/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/goimports/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -960,7 +963,7 @@ diff -urN b/cmd/goimports/BUILD.bazel c/cmd/goimports/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/gomvpkg/BUILD.bazel c/cmd/gomvpkg/BUILD.bazel ---- b/cmd/gomvpkg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/gomvpkg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/gomvpkg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -982,7 +985,7 @@ diff -urN b/cmd/gomvpkg/BUILD.bazel c/cmd/gomvpkg/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/gorename/BUILD.bazel c/cmd/gorename/BUILD.bazel ---- b/cmd/gorename/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/gorename/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/gorename/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -1010,7 +1013,7 @@ diff -urN b/cmd/gorename/BUILD.bazel c/cmd/gorename/BUILD.bazel + deps = ["//internal/testenv"], +) diff -urN b/cmd/gotype/BUILD.bazel c/cmd/gotype/BUILD.bazel ---- b/cmd/gotype/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/gotype/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/gotype/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1032,7 +1035,7 @@ diff -urN b/cmd/gotype/BUILD.bazel c/cmd/gotype/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/goyacc/BUILD.bazel c/cmd/goyacc/BUILD.bazel ---- b/cmd/goyacc/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/goyacc/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/goyacc/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1053,7 +1056,7 @@ diff -urN b/cmd/goyacc/BUILD.bazel c/cmd/goyacc/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/goyacc/testdata/expr/BUILD.bazel c/cmd/goyacc/testdata/expr/BUILD.bazel ---- b/cmd/goyacc/testdata/expr/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/goyacc/testdata/expr/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/goyacc/testdata/expr/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1071,9 +1074,9 @@ diff -urN b/cmd/goyacc/testdata/expr/BUILD.bazel c/cmd/goyacc/testdata/expr/BUIL + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/BUILD.bazel c/cmd/guru/BUILD.bazel ---- b/cmd/guru/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,56 @@ +@@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( @@ -1127,11 +1130,12 @@ diff -urN b/cmd/guru/BUILD.bazel c/cmd/guru/BUILD.bazel + "guru_test.go", + "unit_test.go", + ], ++ data = glob(["testdata/**"]), + embed = [":guru_lib"], + deps = ["//internal/testenv"], +) diff -urN b/cmd/guru/serial/BUILD.bazel c/cmd/guru/serial/BUILD.bazel ---- b/cmd/guru/serial/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/serial/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/serial/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1149,7 +1153,7 @@ diff -urN b/cmd/guru/serial/BUILD.bazel c/cmd/guru/serial/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/alias/BUILD.bazel c/cmd/guru/testdata/src/alias/BUILD.bazel ---- b/cmd/guru/testdata/src/alias/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/alias/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/alias/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1167,7 +1171,7 @@ diff -urN b/cmd/guru/testdata/src/alias/BUILD.bazel c/cmd/guru/testdata/src/alia + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/calls/BUILD.bazel c/cmd/guru/testdata/src/calls/BUILD.bazel ---- b/cmd/guru/testdata/src/calls/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/calls/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/calls/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1185,7 +1189,7 @@ diff -urN b/cmd/guru/testdata/src/calls/BUILD.bazel c/cmd/guru/testdata/src/call + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/calls-json/BUILD.bazel c/cmd/guru/testdata/src/calls-json/BUILD.bazel ---- b/cmd/guru/testdata/src/calls-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/calls-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/calls-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1203,7 +1207,7 @@ diff -urN b/cmd/guru/testdata/src/calls-json/BUILD.bazel c/cmd/guru/testdata/src + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/definition-json/BUILD.bazel c/cmd/guru/testdata/src/definition-json/BUILD.bazel ---- b/cmd/guru/testdata/src/definition-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/definition-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/definition-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1224,7 +1228,7 @@ diff -urN b/cmd/guru/testdata/src/definition-json/BUILD.bazel c/cmd/guru/testdat + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/describe/BUILD.bazel c/cmd/guru/testdata/src/describe/BUILD.bazel ---- b/cmd/guru/testdata/src/describe/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/describe/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/describe/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1242,7 +1246,7 @@ diff -urN b/cmd/guru/testdata/src/describe/BUILD.bazel c/cmd/guru/testdata/src/d + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/describe-json/BUILD.bazel c/cmd/guru/testdata/src/describe-json/BUILD.bazel ---- b/cmd/guru/testdata/src/describe-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/describe-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/describe-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1260,7 +1264,7 @@ diff -urN b/cmd/guru/testdata/src/describe-json/BUILD.bazel c/cmd/guru/testdata/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/freevars/BUILD.bazel c/cmd/guru/testdata/src/freevars/BUILD.bazel ---- b/cmd/guru/testdata/src/freevars/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/freevars/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/freevars/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1278,7 +1282,7 @@ diff -urN b/cmd/guru/testdata/src/freevars/BUILD.bazel c/cmd/guru/testdata/src/f + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/implements/BUILD.bazel c/cmd/guru/testdata/src/implements/BUILD.bazel ---- b/cmd/guru/testdata/src/implements/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/implements/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/implements/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1296,7 +1300,7 @@ diff -urN b/cmd/guru/testdata/src/implements/BUILD.bazel c/cmd/guru/testdata/src + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/implements-json/BUILD.bazel c/cmd/guru/testdata/src/implements-json/BUILD.bazel ---- b/cmd/guru/testdata/src/implements-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/implements-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/implements-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1314,7 +1318,7 @@ diff -urN b/cmd/guru/testdata/src/implements-json/BUILD.bazel c/cmd/guru/testdat + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/implements-methods/BUILD.bazel c/cmd/guru/testdata/src/implements-methods/BUILD.bazel ---- b/cmd/guru/testdata/src/implements-methods/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/implements-methods/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/implements-methods/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1332,7 +1336,7 @@ diff -urN b/cmd/guru/testdata/src/implements-methods/BUILD.bazel c/cmd/guru/test + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel c/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel ---- b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1350,7 +1354,7 @@ diff -urN b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel c/cmd/guru + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/imports/BUILD.bazel c/cmd/guru/testdata/src/imports/BUILD.bazel ---- b/cmd/guru/testdata/src/imports/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/imports/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/imports/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1368,7 +1372,7 @@ diff -urN b/cmd/guru/testdata/src/imports/BUILD.bazel c/cmd/guru/testdata/src/im + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/lib/BUILD.bazel c/cmd/guru/testdata/src/lib/BUILD.bazel ---- b/cmd/guru/testdata/src/lib/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/lib/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/lib/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1386,7 +1390,7 @@ diff -urN b/cmd/guru/testdata/src/lib/BUILD.bazel c/cmd/guru/testdata/src/lib/BU + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel c/cmd/guru/testdata/src/lib/sublib/BUILD.bazel ---- b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/lib/sublib/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -1404,7 +1408,7 @@ diff -urN b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel c/cmd/guru/testdata/src + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/main/BUILD.bazel c/cmd/guru/testdata/src/main/BUILD.bazel ---- b/cmd/guru/testdata/src/main/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/main/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/main/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1422,7 +1426,7 @@ diff -urN b/cmd/guru/testdata/src/main/BUILD.bazel c/cmd/guru/testdata/src/main/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/peers/BUILD.bazel c/cmd/guru/testdata/src/peers/BUILD.bazel ---- b/cmd/guru/testdata/src/peers/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/peers/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/peers/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1440,7 +1444,7 @@ diff -urN b/cmd/guru/testdata/src/peers/BUILD.bazel c/cmd/guru/testdata/src/peer + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/peers-json/BUILD.bazel c/cmd/guru/testdata/src/peers-json/BUILD.bazel ---- b/cmd/guru/testdata/src/peers-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/peers-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/peers-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1458,7 +1462,7 @@ diff -urN b/cmd/guru/testdata/src/peers-json/BUILD.bazel c/cmd/guru/testdata/src + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/pointsto/BUILD.bazel c/cmd/guru/testdata/src/pointsto/BUILD.bazel ---- b/cmd/guru/testdata/src/pointsto/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/pointsto/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/pointsto/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1476,7 +1480,7 @@ diff -urN b/cmd/guru/testdata/src/pointsto/BUILD.bazel c/cmd/guru/testdata/src/p + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel c/cmd/guru/testdata/src/pointsto-json/BUILD.bazel ---- b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/pointsto-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1494,7 +1498,7 @@ diff -urN b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel c/cmd/guru/testdata/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/referrers/BUILD.bazel c/cmd/guru/testdata/src/referrers/BUILD.bazel ---- b/cmd/guru/testdata/src/referrers/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/referrers/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/referrers/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -1521,7 +1525,7 @@ diff -urN b/cmd/guru/testdata/src/referrers/BUILD.bazel c/cmd/guru/testdata/src/ + embed = [":referrers_lib"], +) diff -urN b/cmd/guru/testdata/src/referrers-json/BUILD.bazel c/cmd/guru/testdata/src/referrers-json/BUILD.bazel ---- b/cmd/guru/testdata/src/referrers-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/referrers-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/referrers-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1539,7 +1543,7 @@ diff -urN b/cmd/guru/testdata/src/referrers-json/BUILD.bazel c/cmd/guru/testdata + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/reflection/BUILD.bazel c/cmd/guru/testdata/src/reflection/BUILD.bazel ---- b/cmd/guru/testdata/src/reflection/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/reflection/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/reflection/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1557,7 +1561,7 @@ diff -urN b/cmd/guru/testdata/src/reflection/BUILD.bazel c/cmd/guru/testdata/src + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/softerrs/BUILD.bazel c/cmd/guru/testdata/src/softerrs/BUILD.bazel ---- b/cmd/guru/testdata/src/softerrs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/softerrs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/softerrs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1575,7 +1579,7 @@ diff -urN b/cmd/guru/testdata/src/softerrs/BUILD.bazel c/cmd/guru/testdata/src/s + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/what/BUILD.bazel c/cmd/guru/testdata/src/what/BUILD.bazel ---- b/cmd/guru/testdata/src/what/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/what/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/what/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1593,7 +1597,7 @@ diff -urN b/cmd/guru/testdata/src/what/BUILD.bazel c/cmd/guru/testdata/src/what/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/what-json/BUILD.bazel c/cmd/guru/testdata/src/what-json/BUILD.bazel ---- b/cmd/guru/testdata/src/what-json/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/what-json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/what-json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1611,7 +1615,7 @@ diff -urN b/cmd/guru/testdata/src/what-json/BUILD.bazel c/cmd/guru/testdata/src/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/guru/testdata/src/whicherrs/BUILD.bazel c/cmd/guru/testdata/src/whicherrs/BUILD.bazel ---- b/cmd/guru/testdata/src/whicherrs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/guru/testdata/src/whicherrs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/guru/testdata/src/whicherrs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1629,7 +1633,7 @@ diff -urN b/cmd/guru/testdata/src/whicherrs/BUILD.bazel c/cmd/guru/testdata/src/ + visibility = ["//visibility:public"], +) diff -urN b/cmd/html2article/BUILD.bazel c/cmd/html2article/BUILD.bazel ---- b/cmd/html2article/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/html2article/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/html2article/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1651,7 +1655,7 @@ diff -urN b/cmd/html2article/BUILD.bazel c/cmd/html2article/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/present/BUILD.bazel c/cmd/present/BUILD.bazel ---- b/cmd/present/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/present/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/present/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1680,7 +1684,7 @@ diff -urN b/cmd/present/BUILD.bazel c/cmd/present/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/present2md/BUILD.bazel c/cmd/present2md/BUILD.bazel ---- b/cmd/present2md/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/present2md/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/present2md/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1698,8 +1702,114 @@ diff -urN b/cmd/present2md/BUILD.bazel c/cmd/present2md/BUILD.bazel + embed = [":present2md_lib"], + visibility = ["//visibility:public"], +) +diff -urN b/cmd/signature-fuzzer/fuzz-driver/BUILD.bazel c/cmd/signature-fuzzer/fuzz-driver/BUILD.bazel +--- b/cmd/signature-fuzzer/fuzz-driver/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/cmd/signature-fuzzer/fuzz-driver/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,22 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") ++ ++go_library( ++ name = "fuzz-driver_lib", ++ srcs = ["driver.go"], ++ importpath = "golang.org/x/tools/cmd/signature-fuzzer/fuzz-driver", ++ visibility = ["//visibility:private"], ++ deps = ["//cmd/signature-fuzzer/internal/fuzz-generator"], ++) ++ ++go_binary( ++ name = "fuzz-driver", ++ embed = [":fuzz-driver_lib"], ++ visibility = ["//visibility:public"], ++) ++ ++go_test( ++ name = "fuzz-driver_test", ++ srcs = ["drv_test.go"], ++ embed = [":fuzz-driver_lib"], ++ deps = ["//internal/testenv"], ++) +diff -urN b/cmd/signature-fuzzer/fuzz-runner/BUILD.bazel c/cmd/signature-fuzzer/fuzz-runner/BUILD.bazel +--- b/cmd/signature-fuzzer/fuzz-runner/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/cmd/signature-fuzzer/fuzz-runner/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,22 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") ++ ++go_library( ++ name = "fuzz-runner_lib", ++ srcs = ["runner.go"], ++ importpath = "golang.org/x/tools/cmd/signature-fuzzer/fuzz-runner", ++ visibility = ["//visibility:private"], ++ deps = ["//cmd/signature-fuzzer/internal/fuzz-generator"], ++) ++ ++go_binary( ++ name = "fuzz-runner", ++ embed = [":fuzz-runner_lib"], ++ visibility = ["//visibility:public"], ++) ++ ++go_test( ++ name = "fuzz-runner_test", ++ srcs = ["rnr_test.go"], ++ embed = [":fuzz-runner_lib"], ++ deps = ["//internal/testenv"], ++) +diff -urN b/cmd/signature-fuzzer/fuzz-runner/testdata/BUILD.bazel c/cmd/signature-fuzzer/fuzz-runner/testdata/BUILD.bazel +--- b/cmd/signature-fuzzer/fuzz-runner/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/cmd/signature-fuzzer/fuzz-runner/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") ++ ++go_library( ++ name = "testdata_lib", ++ srcs = ["himom.go"], ++ importpath = "golang.org/x/tools/cmd/signature-fuzzer/fuzz-runner/testdata", ++ visibility = ["//visibility:private"], ++) ++ ++go_binary( ++ name = "testdata", ++ embed = [":testdata_lib"], ++ visibility = ["//visibility:public"], ++) +diff -urN b/cmd/signature-fuzzer/internal/fuzz-generator/BUILD.bazel c/cmd/signature-fuzzer/internal/fuzz-generator/BUILD.bazel +--- b/cmd/signature-fuzzer/internal/fuzz-generator/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/cmd/signature-fuzzer/internal/fuzz-generator/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,32 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "fuzz-generator", ++ srcs = [ ++ "arrayparm.go", ++ "generator.go", ++ "mapparm.go", ++ "numparm.go", ++ "parm.go", ++ "pointerparm.go", ++ "stringparm.go", ++ "structparm.go", ++ "typedefparm.go", ++ "wraprand.go", ++ ], ++ importpath = "golang.org/x/tools/cmd/signature-fuzzer/internal/fuzz-generator", ++ visibility = ["//cmd/signature-fuzzer:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":fuzz-generator", ++ visibility = ["//cmd/signature-fuzzer:__subpackages__"], ++) ++ ++go_test( ++ name = "fuzz-generator_test", ++ srcs = ["gen_test.go"], ++ embed = [":fuzz-generator"], ++ deps = ["//internal/testenv"], ++) diff -urN b/cmd/splitdwarf/BUILD.bazel c/cmd/splitdwarf/BUILD.bazel ---- b/cmd/splitdwarf/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/splitdwarf/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/splitdwarf/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1750,7 +1860,7 @@ diff -urN b/cmd/splitdwarf/BUILD.bazel c/cmd/splitdwarf/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/splitdwarf/internal/macho/BUILD.bazel c/cmd/splitdwarf/internal/macho/BUILD.bazel ---- b/cmd/splitdwarf/internal/macho/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/splitdwarf/internal/macho/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/splitdwarf/internal/macho/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -1781,7 +1891,7 @@ diff -urN b/cmd/splitdwarf/internal/macho/BUILD.bazel c/cmd/splitdwarf/internal/ + embed = [":macho"], +) diff -urN b/cmd/ssadump/BUILD.bazel c/cmd/ssadump/BUILD.bazel ---- b/cmd/ssadump/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/ssadump/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/ssadump/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1806,7 +1916,7 @@ diff -urN b/cmd/ssadump/BUILD.bazel c/cmd/ssadump/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/stress/BUILD.bazel c/cmd/stress/BUILD.bazel ---- b/cmd/stress/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/stress/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/stress/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1866,7 +1976,7 @@ diff -urN b/cmd/stress/BUILD.bazel c/cmd/stress/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/cmd/stringer/BUILD.bazel c/cmd/stringer/BUILD.bazel ---- b/cmd/stringer/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/stringer/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/stringer/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,69 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") @@ -1939,7 +2049,7 @@ diff -urN b/cmd/stringer/BUILD.bazel c/cmd/stringer/BUILD.bazel + }), +) diff -urN b/cmd/stringer/testdata/BUILD.bazel c/cmd/stringer/testdata/BUILD.bazel ---- b/cmd/stringer/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/stringer/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/stringer/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1970,7 +2080,7 @@ diff -urN b/cmd/stringer/testdata/BUILD.bazel c/cmd/stringer/testdata/BUILD.baze + visibility = ["//visibility:public"], +) diff -urN b/cmd/stringer/testdata/typeparams/BUILD.bazel c/cmd/stringer/testdata/typeparams/BUILD.bazel ---- b/cmd/stringer/testdata/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/stringer/testdata/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/stringer/testdata/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -1991,7 +2101,7 @@ diff -urN b/cmd/stringer/testdata/typeparams/BUILD.bazel c/cmd/stringer/testdata + visibility = ["//visibility:public"], +) diff -urN b/cmd/toolstash/BUILD.bazel c/cmd/toolstash/BUILD.bazel ---- b/cmd/toolstash/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cmd/toolstash/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cmd/toolstash/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -2013,7 +2123,7 @@ diff -urN b/cmd/toolstash/BUILD.bazel c/cmd/toolstash/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/container/intsets/BUILD.bazel c/container/intsets/BUILD.bazel ---- b/container/intsets/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/container/intsets/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/container/intsets/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2040,7 +2150,7 @@ diff -urN b/container/intsets/BUILD.bazel c/container/intsets/BUILD.bazel + embed = [":intsets"], +) diff -urN b/copyright/BUILD.bazel c/copyright/BUILD.bazel ---- b/copyright/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/copyright/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/copyright/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2064,7 +2174,7 @@ diff -urN b/copyright/BUILD.bazel c/copyright/BUILD.bazel + embed = [":copyright"], +) diff -urN b/cover/BUILD.bazel c/cover/BUILD.bazel ---- b/cover/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/cover/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/cover/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2088,7 +2198,7 @@ diff -urN b/cover/BUILD.bazel c/cover/BUILD.bazel + embed = [":cover"], +) diff -urN b/go/analysis/BUILD.bazel c/go/analysis/BUILD.bazel ---- b/go/analysis/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2118,7 +2228,7 @@ diff -urN b/go/analysis/BUILD.bazel c/go/analysis/BUILD.bazel + embed = [":analysis"], +) diff -urN b/go/analysis/analysistest/BUILD.bazel c/go/analysis/analysistest/BUILD.bazel ---- b/go/analysis/analysistest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/analysistest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/analysistest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2156,7 +2266,7 @@ diff -urN b/go/analysis/analysistest/BUILD.bazel c/go/analysis/analysistest/BUIL + ], +) diff -urN b/go/analysis/internal/analysisflags/BUILD.bazel c/go/analysis/internal/analysisflags/BUILD.bazel ---- b/go/analysis/internal/analysisflags/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/internal/analysisflags/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/internal/analysisflags/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2187,7 +2297,7 @@ diff -urN b/go/analysis/internal/analysisflags/BUILD.bazel c/go/analysis/interna + ], +) diff -urN b/go/analysis/internal/checker/BUILD.bazel c/go/analysis/internal/checker/BUILD.bazel ---- b/go/analysis/internal/checker/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/internal/checker/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/internal/checker/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2225,7 +2335,7 @@ diff -urN b/go/analysis/internal/checker/BUILD.bazel c/go/analysis/internal/chec + ], +) diff -urN b/go/analysis/internal/facts/BUILD.bazel c/go/analysis/internal/facts/BUILD.bazel ---- b/go/analysis/internal/facts/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/internal/facts/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/internal/facts/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2263,7 +2373,7 @@ diff -urN b/go/analysis/internal/facts/BUILD.bazel c/go/analysis/internal/facts/ + ], +) diff -urN b/go/analysis/multichecker/BUILD.bazel c/go/analysis/multichecker/BUILD.bazel ---- b/go/analysis/multichecker/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/multichecker/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/multichecker/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -2298,14 +2408,18 @@ diff -urN b/go/analysis/multichecker/BUILD.bazel c/go/analysis/multichecker/BUIL + ], +) diff -urN b/go/analysis/passes/asmdecl/BUILD.bazel c/go/analysis/passes/asmdecl/BUILD.bazel ---- b/go/analysis/passes/asmdecl/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/asmdecl/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/asmdecl/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,27 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "asmdecl", -+ srcs = ["asmdecl.go"], ++ srcs = [ ++ "arches_go118.go", ++ "arches_go119.go", ++ "asmdecl.go", ++ ], + importpath = "golang.org/x/tools/go/analysis/passes/asmdecl", + visibility = ["//visibility:public"], + deps = [ @@ -2323,15 +2437,16 @@ diff -urN b/go/analysis/passes/asmdecl/BUILD.bazel c/go/analysis/passes/asmdecl/ +go_test( + name = "asmdecl_test", + srcs = ["asmdecl_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":asmdecl", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel c/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -2339,6 +2454,7 @@ diff -urN b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel c/go/analysis/ + srcs = [ + "asm.go", + "asm1.s", ++ "asm10.s", + "asm2.s", + "asm3.s", + "asm4.s", @@ -2358,9 +2474,9 @@ diff -urN b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/assign/BUILD.bazel c/go/analysis/passes/assign/BUILD.bazel ---- b/go/analysis/passes/assign/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/assign/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/assign/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2385,6 +2501,7 @@ diff -urN b/go/analysis/passes/assign/BUILD.bazel c/go/analysis/passes/assign/BU +go_test( + name = "assign_test", + srcs = ["assign_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":assign", + "//go/analysis/analysistest", @@ -2392,7 +2509,7 @@ diff -urN b/go/analysis/passes/assign/BUILD.bazel c/go/analysis/passes/assign/BU + ], +) diff -urN b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel c/go/analysis/passes/assign/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/assign/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2410,7 +2527,7 @@ diff -urN b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2428,9 +2545,9 @@ diff -urN b/go/analysis/passes/assign/testdata/src/typeparams/BUILD.bazel c/go/a + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/atomic/BUILD.bazel c/go/analysis/passes/atomic/BUILD.bazel ---- b/go/analysis/passes/atomic/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomic/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomic/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2455,6 +2572,7 @@ diff -urN b/go/analysis/passes/atomic/BUILD.bazel c/go/analysis/passes/atomic/BU +go_test( + name = "atomic_test", + srcs = ["atomic_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":atomic", + "//go/analysis/analysistest", @@ -2462,7 +2580,7 @@ diff -urN b/go/analysis/passes/atomic/BUILD.bazel c/go/analysis/passes/atomic/BU + ], +) diff -urN b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel c/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2480,7 +2598,7 @@ diff -urN b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2498,9 +2616,9 @@ diff -urN b/go/analysis/passes/atomic/testdata/src/typeparams/BUILD.bazel c/go/a + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/atomicalign/BUILD.bazel c/go/analysis/passes/atomicalign/BUILD.bazel ---- b/go/analysis/passes/atomicalign/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomicalign/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomicalign/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2525,13 +2643,14 @@ diff -urN b/go/analysis/passes/atomicalign/BUILD.bazel c/go/analysis/passes/atom +go_test( + name = "atomicalign_test", + srcs = ["atomicalign_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":atomicalign", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel c/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2552,7 +2671,7 @@ diff -urN b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel c/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2573,9 +2692,9 @@ diff -urN b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/bools/BUILD.bazel c/go/analysis/passes/bools/BUILD.bazel ---- b/go/analysis/passes/bools/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/bools/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/bools/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2600,6 +2719,7 @@ diff -urN b/go/analysis/passes/bools/BUILD.bazel c/go/analysis/passes/bools/BUIL +go_test( + name = "bools_test", + srcs = ["bools_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":bools", + "//go/analysis/analysistest", @@ -2607,7 +2727,7 @@ diff -urN b/go/analysis/passes/bools/BUILD.bazel c/go/analysis/passes/bools/BUIL + ], +) diff -urN b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel c/go/analysis/passes/bools/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/bools/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2625,7 +2745,7 @@ diff -urN b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel c/go/analysis/pa + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2643,9 +2763,9 @@ diff -urN b/go/analysis/passes/bools/testdata/src/typeparams/BUILD.bazel c/go/an + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/buildssa/BUILD.bazel c/go/analysis/passes/buildssa/BUILD.bazel ---- b/go/analysis/passes/buildssa/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/buildssa/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/buildssa/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,27 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2668,13 +2788,15 @@ diff -urN b/go/analysis/passes/buildssa/BUILD.bazel c/go/analysis/passes/buildss +go_test( + name = "buildssa_test", + srcs = ["buildssa_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":buildssa", + "//go/analysis/analysistest", ++ "//internal/typeparams", + ], +) diff -urN b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel c/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2691,10 +2813,46 @@ diff -urN b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel c/go/analysis + actual = ":a", + visibility = ["//visibility:public"], +) +diff -urN b/go/analysis/passes/buildssa/testdata/src/b/BUILD.bazel c/go/analysis/passes/buildssa/testdata/src/b/BUILD.bazel +--- b/go/analysis/passes/buildssa/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/analysis/passes/buildssa/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "b", ++ srcs = ["b.go"], ++ importpath = "golang.org/x/tools/go/analysis/passes/buildssa/testdata/src/b", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":b", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/analysis/passes/buildssa/testdata/src/c/BUILD.bazel c/go/analysis/passes/buildssa/testdata/src/c/BUILD.bazel +--- b/go/analysis/passes/buildssa/testdata/src/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/analysis/passes/buildssa/testdata/src/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "c", ++ srcs = ["c.go"], ++ importpath = "golang.org/x/tools/go/analysis/passes/buildssa/testdata/src/c", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":c", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/analysis/passes/buildtag/BUILD.bazel c/go/analysis/passes/buildtag/BUILD.bazel ---- b/go/analysis/passes/buildtag/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/buildtag/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/buildtag/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2720,6 +2878,7 @@ diff -urN b/go/analysis/passes/buildtag/BUILD.bazel c/go/analysis/passes/buildta +go_test( + name = "buildtag_test", + srcs = ["buildtag_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":buildtag", + "//go/analysis", @@ -2727,7 +2886,7 @@ diff -urN b/go/analysis/passes/buildtag/BUILD.bazel c/go/analysis/passes/buildta + ], +) diff -urN b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel c/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2749,9 +2908,9 @@ diff -urN b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/cgocall/BUILD.bazel c/go/analysis/passes/cgocall/BUILD.bazel ---- b/go/analysis/passes/cgocall/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/cgocall/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/cgocall/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2774,6 +2933,7 @@ diff -urN b/go/analysis/passes/cgocall/BUILD.bazel c/go/analysis/passes/cgocall/ +go_test( + name = "cgocall_test", + srcs = ["cgocall_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":cgocall", + "//go/analysis/analysistest", @@ -2781,7 +2941,7 @@ diff -urN b/go/analysis/passes/cgocall/BUILD.bazel c/go/analysis/passes/cgocall/ + ], +) diff -urN b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2803,7 +2963,7 @@ diff -urN b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2821,7 +2981,7 @@ diff -urN b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel ---- b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2839,7 +2999,7 @@ diff -urN b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2858,9 +3018,9 @@ diff -urN b/go/analysis/passes/cgocall/testdata/src/typeparams/BUILD.bazel c/go/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/composite/BUILD.bazel c/go/analysis/passes/composite/BUILD.bazel ---- b/go/analysis/passes/composite/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/composite/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/composite/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,33 @@ +@@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2888,6 +3048,7 @@ diff -urN b/go/analysis/passes/composite/BUILD.bazel c/go/analysis/passes/compos +go_test( + name = "composite_test", + srcs = ["composite_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":composite", + "//go/analysis/analysistest", @@ -2895,10 +3056,10 @@ diff -urN b/go/analysis/passes/composite/BUILD.bazel c/go/analysis/passes/compos + ], +) diff -urN b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel c/go/analysis/passes/composite/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/composite/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,14 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library") +@@ -0,0 +1,20 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "a", @@ -2912,8 +3073,14 @@ diff -urN b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel c/go/analysi + actual = ":a", + visibility = ["//visibility:public"], +) ++ ++go_test( ++ name = "a_test", ++ srcs = ["a_fuzz_test.go"], ++ embed = [":a"], ++) diff -urN b/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2931,7 +3098,7 @@ diff -urN b/go/analysis/passes/composite/testdata/src/typeparams/BUILD.bazel c/g + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel c/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel ---- b/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -2949,9 +3116,9 @@ diff -urN b/go/analysis/passes/composite/testdata/src/typeparams/lib/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/copylock/BUILD.bazel c/go/analysis/passes/copylock/BUILD.bazel ---- b/go/analysis/passes/copylock/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/copylock/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/copylock/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -2977,6 +3144,7 @@ diff -urN b/go/analysis/passes/copylock/BUILD.bazel c/go/analysis/passes/copyloc +go_test( + name = "copylock_test", + srcs = ["copylock_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":copylock", + "//go/analysis/analysistest", @@ -2984,7 +3152,7 @@ diff -urN b/go/analysis/passes/copylock/BUILD.bazel c/go/analysis/passes/copyloc + ], +) diff -urN b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel c/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3006,7 +3174,7 @@ diff -urN b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3024,9 +3192,9 @@ diff -urN b/go/analysis/passes/copylock/testdata/src/typeparams/BUILD.bazel c/go + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ctrlflow/BUILD.bazel c/go/analysis/passes/ctrlflow/BUILD.bazel ---- b/go/analysis/passes/ctrlflow/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ctrlflow/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ctrlflow/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3052,6 +3220,7 @@ diff -urN b/go/analysis/passes/ctrlflow/BUILD.bazel c/go/analysis/passes/ctrlflo +go_test( + name = "ctrlflow_test", + srcs = ["ctrlflow_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":ctrlflow", + "//go/analysis/analysistest", @@ -3059,7 +3228,7 @@ diff -urN b/go/analysis/passes/ctrlflow/BUILD.bazel c/go/analysis/passes/ctrlflo + ], +) diff -urN b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel c/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3077,7 +3246,7 @@ diff -urN b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel c/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel ---- b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3095,7 +3264,7 @@ diff -urN b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3113,9 +3282,9 @@ diff -urN b/go/analysis/passes/ctrlflow/testdata/src/typeparams/BUILD.bazel c/go + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/deepequalerrors/BUILD.bazel c/go/analysis/passes/deepequalerrors/BUILD.bazel ---- b/go/analysis/passes/deepequalerrors/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/deepequalerrors/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/deepequalerrors/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3140,6 +3309,7 @@ diff -urN b/go/analysis/passes/deepequalerrors/BUILD.bazel c/go/analysis/passes/ +go_test( + name = "deepequalerrors_test", + srcs = ["deepequalerrors_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":deepequalerrors", + "//go/analysis/analysistest", @@ -3147,7 +3317,7 @@ diff -urN b/go/analysis/passes/deepequalerrors/BUILD.bazel c/go/analysis/passes/ + ], +) diff -urN b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel c/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3165,7 +3335,7 @@ diff -urN b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel c/go/a + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3183,9 +3353,9 @@ diff -urN b/go/analysis/passes/deepequalerrors/testdata/src/typeparams/BUILD.baz + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/errorsas/BUILD.bazel c/go/analysis/passes/errorsas/BUILD.bazel ---- b/go/analysis/passes/errorsas/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/errorsas/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/errorsas/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3210,6 +3380,7 @@ diff -urN b/go/analysis/passes/errorsas/BUILD.bazel c/go/analysis/passes/errorsa +go_test( + name = "errorsas_test", + srcs = ["errorsas_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":errorsas", + "//go/analysis/analysistest", @@ -3217,7 +3388,7 @@ diff -urN b/go/analysis/passes/errorsas/BUILD.bazel c/go/analysis/passes/errorsa + ], +) diff -urN b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel c/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3235,7 +3406,7 @@ diff -urN b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3253,9 +3424,9 @@ diff -urN b/go/analysis/passes/errorsas/testdata/src/typeparams/BUILD.bazel c/go + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/fieldalignment/BUILD.bazel c/go/analysis/passes/fieldalignment/BUILD.bazel ---- b/go/analysis/passes/fieldalignment/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/fieldalignment/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/fieldalignment/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3279,13 +3450,14 @@ diff -urN b/go/analysis/passes/fieldalignment/BUILD.bazel c/go/analysis/passes/f +go_test( + name = "fieldalignment_test", + srcs = ["fieldalignment_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":fieldalignment", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel c/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel ---- b/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3307,7 +3479,7 @@ diff -urN b/go/analysis/passes/fieldalignment/cmd/fieldalignment/BUILD.bazel c/g + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel c/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3329,9 +3501,9 @@ diff -urN b/go/analysis/passes/fieldalignment/testdata/src/a/BUILD.bazel c/go/an + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/findcall/BUILD.bazel c/go/analysis/passes/findcall/BUILD.bazel ---- b/go/analysis/passes/findcall/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/findcall/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/findcall/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,24 @@ +@@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3351,13 +3523,14 @@ diff -urN b/go/analysis/passes/findcall/BUILD.bazel c/go/analysis/passes/findcal +go_test( + name = "findcall_test", + srcs = ["findcall_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":findcall", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel c/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel ---- b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3379,7 +3552,7 @@ diff -urN b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel c/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3397,9 +3570,9 @@ diff -urN b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/framepointer/BUILD.bazel c/go/analysis/passes/framepointer/BUILD.bazel ---- b/go/analysis/passes/framepointer/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/framepointer/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/framepointer/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,27 @@ +@@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3422,13 +3595,14 @@ diff -urN b/go/analysis/passes/framepointer/BUILD.bazel c/go/analysis/passes/fra +go_test( + name = "framepointer_test", + srcs = ["framepointer_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":framepointer", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel c/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3452,9 +3626,9 @@ diff -urN b/go/analysis/passes/framepointer/testdata/src/a/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/httpresponse/BUILD.bazel c/go/analysis/passes/httpresponse/BUILD.bazel ---- b/go/analysis/passes/httpresponse/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/httpresponse/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/httpresponse/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3479,6 +3653,7 @@ diff -urN b/go/analysis/passes/httpresponse/BUILD.bazel c/go/analysis/passes/htt +go_test( + name = "httpresponse_test", + srcs = ["httpresponse_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":httpresponse", + "//go/analysis/analysistest", @@ -3486,7 +3661,7 @@ diff -urN b/go/analysis/passes/httpresponse/BUILD.bazel c/go/analysis/passes/htt + ], +) diff -urN b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel c/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3504,7 +3679,7 @@ diff -urN b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3522,9 +3697,9 @@ diff -urN b/go/analysis/passes/httpresponse/testdata/src/typeparams/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ifaceassert/BUILD.bazel c/go/analysis/passes/ifaceassert/BUILD.bazel ---- b/go/analysis/passes/ifaceassert/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ifaceassert/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ifaceassert/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,33 @@ +@@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3552,6 +3727,7 @@ diff -urN b/go/analysis/passes/ifaceassert/BUILD.bazel c/go/analysis/passes/ifac +go_test( + name = "ifaceassert_test", + srcs = ["ifaceassert_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":ifaceassert", + "//go/analysis/analysistest", @@ -3559,7 +3735,7 @@ diff -urN b/go/analysis/passes/ifaceassert/BUILD.bazel c/go/analysis/passes/ifac + ], +) diff -urN b/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel c/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel ---- b/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3581,7 +3757,7 @@ diff -urN b/go/analysis/passes/ifaceassert/cmd/ifaceassert/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel c/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3599,7 +3775,7 @@ diff -urN b/go/analysis/passes/ifaceassert/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3617,7 +3793,7 @@ diff -urN b/go/analysis/passes/ifaceassert/testdata/src/typeparams/BUILD.bazel c + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/inspect/BUILD.bazel c/go/analysis/passes/inspect/BUILD.bazel ---- b/go/analysis/passes/inspect/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/inspect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/inspect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3639,7 +3815,7 @@ diff -urN b/go/analysis/passes/inspect/BUILD.bazel c/go/analysis/passes/inspect/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/internal/analysisutil/BUILD.bazel c/go/analysis/passes/internal/analysisutil/BUILD.bazel ---- b/go/analysis/passes/internal/analysisutil/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/internal/analysisutil/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/internal/analysisutil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -3666,9 +3842,9 @@ diff -urN b/go/analysis/passes/internal/analysisutil/BUILD.bazel c/go/analysis/p + ], +) diff -urN b/go/analysis/passes/loopclosure/BUILD.bazel c/go/analysis/passes/loopclosure/BUILD.bazel ---- b/go/analysis/passes/loopclosure/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/loopclosure/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/loopclosure/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3693,6 +3869,7 @@ diff -urN b/go/analysis/passes/loopclosure/BUILD.bazel c/go/analysis/passes/loop +go_test( + name = "loopclosure_test", + srcs = ["loopclosure_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":loopclosure", + "//go/analysis/analysistest", @@ -3700,7 +3877,7 @@ diff -urN b/go/analysis/passes/loopclosure/BUILD.bazel c/go/analysis/passes/loop + ], +) diff -urN b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel c/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3719,7 +3896,7 @@ diff -urN b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgroup/BUILD.bazel c/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgroup/BUILD.bazel ---- b/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgroup/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgroup/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgroup/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3737,7 +3914,7 @@ diff -urN b/go/analysis/passes/loopclosure/testdata/src/golang.org/x/sync/errgro + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3756,9 +3933,9 @@ diff -urN b/go/analysis/passes/loopclosure/testdata/src/typeparams/BUILD.bazel c + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/lostcancel/BUILD.bazel c/go/analysis/passes/lostcancel/BUILD.bazel ---- b/go/analysis/passes/lostcancel/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/lostcancel/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/lostcancel/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3784,6 +3961,7 @@ diff -urN b/go/analysis/passes/lostcancel/BUILD.bazel c/go/analysis/passes/lostc +go_test( + name = "lostcancel_test", + srcs = ["lostcancel_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":lostcancel", + "//go/analysis/analysistest", @@ -3791,7 +3969,7 @@ diff -urN b/go/analysis/passes/lostcancel/BUILD.bazel c/go/analysis/passes/lostc + ], +) diff -urN b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel c/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel ---- b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3813,7 +3991,7 @@ diff -urN b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel c/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3831,7 +4009,7 @@ diff -urN b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel c/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3849,7 +4027,7 @@ diff -urN b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3867,9 +4045,9 @@ diff -urN b/go/analysis/passes/lostcancel/testdata/src/typeparams/BUILD.bazel c/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/nilfunc/BUILD.bazel c/go/analysis/passes/nilfunc/BUILD.bazel ---- b/go/analysis/passes/nilfunc/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilfunc/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilfunc/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3894,6 +4072,7 @@ diff -urN b/go/analysis/passes/nilfunc/BUILD.bazel c/go/analysis/passes/nilfunc/ +go_test( + name = "nilfunc_test", + srcs = ["nilfunc_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":nilfunc", + "//go/analysis/analysistest", @@ -3901,7 +4080,7 @@ diff -urN b/go/analysis/passes/nilfunc/BUILD.bazel c/go/analysis/passes/nilfunc/ + ], +) diff -urN b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel c/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3919,7 +4098,7 @@ diff -urN b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -3937,9 +4116,9 @@ diff -urN b/go/analysis/passes/nilfunc/testdata/src/typeparams/BUILD.bazel c/go/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/nilness/BUILD.bazel c/go/analysis/passes/nilness/BUILD.bazel ---- b/go/analysis/passes/nilness/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilness/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilness/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -3966,13 +4145,15 @@ diff -urN b/go/analysis/passes/nilness/BUILD.bazel c/go/analysis/passes/nilness/ + "nilness_go117_test.go", + "nilness_test.go", + ], ++ data = glob(["testdata/**"]), + deps = [ + ":nilness", + "//go/analysis/analysistest", ++ "//internal/typeparams", + ], +) diff -urN b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel c/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel ---- b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -3994,7 +4175,7 @@ diff -urN b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel c/go/analysis/pas + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel c/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4012,7 +4193,7 @@ diff -urN b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel c/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4029,10 +4210,28 @@ diff -urN b/go/analysis/passes/nilness/testdata/src/b/BUILD.bazel c/go/analysis/ + actual = ":b", + visibility = ["//visibility:public"], +) +diff -urN b/go/analysis/passes/nilness/testdata/src/c/BUILD.bazel c/go/analysis/passes/nilness/testdata/src/c/BUILD.bazel +--- b/go/analysis/passes/nilness/testdata/src/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/analysis/passes/nilness/testdata/src/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "c", ++ srcs = ["c.go"], ++ importpath = "golang.org/x/tools/go/analysis/passes/nilness/testdata/src/c", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":c", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/analysis/passes/pkgfact/BUILD.bazel c/go/analysis/passes/pkgfact/BUILD.bazel ---- b/go/analysis/passes/pkgfact/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/pkgfact/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/pkgfact/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,24 @@ +@@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4052,13 +4251,14 @@ diff -urN b/go/analysis/passes/pkgfact/BUILD.bazel c/go/analysis/passes/pkgfact/ +go_test( + name = "pkgfact_test", + srcs = ["pkgfact_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":pkgfact", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4076,7 +4276,7 @@ diff -urN b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4094,7 +4294,7 @@ diff -urN b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel ---- b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4112,9 +4312,9 @@ diff -urN b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel c/go/analysis/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/printf/BUILD.bazel c/go/analysis/passes/printf/BUILD.bazel ---- b/go/analysis/passes/printf/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/printf/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/printf/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,35 @@ +@@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4144,6 +4344,7 @@ diff -urN b/go/analysis/passes/printf/BUILD.bazel c/go/analysis/passes/printf/BU +go_test( + name = "printf_test", + srcs = ["printf_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":printf", + "//go/analysis/analysistest", @@ -4151,7 +4352,7 @@ diff -urN b/go/analysis/passes/printf/BUILD.bazel c/go/analysis/passes/printf/BU + ], +) diff -urN b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel c/go/analysis/passes/printf/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/printf/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4169,7 +4370,7 @@ diff -urN b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel c/go/analysis/passes/printf/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/printf/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4187,7 +4388,7 @@ diff -urN b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel c/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel ---- b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4205,7 +4406,7 @@ diff -urN b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4226,9 +4427,9 @@ diff -urN b/go/analysis/passes/printf/testdata/src/typeparams/BUILD.bazel c/go/a + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/reflectvaluecompare/BUILD.bazel c/go/analysis/passes/reflectvaluecompare/BUILD.bazel ---- b/go/analysis/passes/reflectvaluecompare/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/reflectvaluecompare/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/reflectvaluecompare/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4253,13 +4454,14 @@ diff -urN b/go/analysis/passes/reflectvaluecompare/BUILD.bazel c/go/analysis/pas +go_test( + name = "reflectvaluecompare_test", + srcs = ["reflectvaluecompare_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":reflectvaluecompare", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel c/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4277,9 +4479,9 @@ diff -urN b/go/analysis/passes/reflectvaluecompare/testdata/src/a/BUILD.bazel c/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/shadow/BUILD.bazel c/go/analysis/passes/shadow/BUILD.bazel ---- b/go/analysis/passes/shadow/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shadow/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shadow/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4303,13 +4505,14 @@ diff -urN b/go/analysis/passes/shadow/BUILD.bazel c/go/analysis/passes/shadow/BU +go_test( + name = "shadow_test", + srcs = ["shadow_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":shadow", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel c/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel ---- b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -4331,7 +4534,7 @@ diff -urN b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel c/go/analysis/passe + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel c/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4349,9 +4552,9 @@ diff -urN b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel c/go/analysis/p + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/shift/BUILD.bazel c/go/analysis/passes/shift/BUILD.bazel ---- b/go/analysis/passes/shift/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shift/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shift/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,34 @@ +@@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4380,6 +4583,7 @@ diff -urN b/go/analysis/passes/shift/BUILD.bazel c/go/analysis/passes/shift/BUIL +go_test( + name = "shift_test", + srcs = ["shift_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":shift", + "//go/analysis/analysistest", @@ -4387,7 +4591,7 @@ diff -urN b/go/analysis/passes/shift/BUILD.bazel c/go/analysis/passes/shift/BUIL + ], +) diff -urN b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel c/go/analysis/passes/shift/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shift/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4405,7 +4609,7 @@ diff -urN b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel c/go/analysis/pa + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4423,9 +4627,9 @@ diff -urN b/go/analysis/passes/shift/testdata/src/typeparams/BUILD.bazel c/go/an + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/sigchanyzer/BUILD.bazel c/go/analysis/passes/sigchanyzer/BUILD.bazel ---- b/go/analysis/passes/sigchanyzer/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/sigchanyzer/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/sigchanyzer/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4449,13 +4653,14 @@ diff -urN b/go/analysis/passes/sigchanyzer/BUILD.bazel c/go/analysis/passes/sigc +go_test( + name = "sigchanyzer_test", + srcs = ["sigchanyzer_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":sigchanyzer", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel c/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4473,9 +4678,9 @@ diff -urN b/go/analysis/passes/sigchanyzer/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/sortslice/BUILD.bazel c/go/analysis/passes/sortslice/BUILD.bazel ---- b/go/analysis/passes/sortslice/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/sortslice/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/sortslice/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4500,13 +4705,14 @@ diff -urN b/go/analysis/passes/sortslice/BUILD.bazel c/go/analysis/passes/sortsl +go_test( + name = "sortslice_test", + srcs = ["analyzer_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":sortslice", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel c/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4524,9 +4730,9 @@ diff -urN b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel c/go/analysi + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/stdmethods/BUILD.bazel c/go/analysis/passes/stdmethods/BUILD.bazel ---- b/go/analysis/passes/stdmethods/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stdmethods/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stdmethods/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4550,6 +4756,7 @@ diff -urN b/go/analysis/passes/stdmethods/BUILD.bazel c/go/analysis/passes/stdme +go_test( + name = "stdmethods_test", + srcs = ["stdmethods_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":stdmethods", + "//go/analysis/analysistest", @@ -4557,7 +4764,7 @@ diff -urN b/go/analysis/passes/stdmethods/BUILD.bazel c/go/analysis/passes/stdme + ], +) diff -urN b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel c/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4578,7 +4785,7 @@ diff -urN b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel c/go/analys + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4596,9 +4803,9 @@ diff -urN b/go/analysis/passes/stdmethods/testdata/src/typeparams/BUILD.bazel c/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/stringintconv/BUILD.bazel c/go/analysis/passes/stringintconv/BUILD.bazel ---- b/go/analysis/passes/stringintconv/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stringintconv/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stringintconv/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4623,6 +4830,7 @@ diff -urN b/go/analysis/passes/stringintconv/BUILD.bazel c/go/analysis/passes/st +go_test( + name = "stringintconv_test", + srcs = ["string_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":stringintconv", + "//go/analysis/analysistest", @@ -4630,7 +4838,7 @@ diff -urN b/go/analysis/passes/stringintconv/BUILD.bazel c/go/analysis/passes/st + ], +) diff -urN b/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel c/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel ---- b/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -4652,7 +4860,7 @@ diff -urN b/go/analysis/passes/stringintconv/cmd/stringintconv/BUILD.bazel c/go/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel c/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4670,7 +4878,7 @@ diff -urN b/go/analysis/passes/stringintconv/testdata/src/a/BUILD.bazel c/go/ana + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4688,9 +4896,9 @@ diff -urN b/go/analysis/passes/stringintconv/testdata/src/typeparams/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/structtag/BUILD.bazel c/go/analysis/passes/structtag/BUILD.bazel ---- b/go/analysis/passes/structtag/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/structtag/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/structtag/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4714,13 +4922,14 @@ diff -urN b/go/analysis/passes/structtag/BUILD.bazel c/go/analysis/passes/struct +go_test( + name = "structtag_test", + srcs = ["structtag_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":structtag", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel c/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4738,7 +4947,7 @@ diff -urN b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel c/go/analysi + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel c/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel ---- b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4756,9 +4965,9 @@ diff -urN b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/testinggoroutine/BUILD.bazel c/go/analysis/passes/testinggoroutine/BUILD.bazel ---- b/go/analysis/passes/testinggoroutine/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/testinggoroutine/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/testinggoroutine/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4784,6 +4993,7 @@ diff -urN b/go/analysis/passes/testinggoroutine/BUILD.bazel c/go/analysis/passes +go_test( + name = "testinggoroutine_test", + srcs = ["testinggoroutine_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":testinggoroutine", + "//go/analysis/analysistest", @@ -4791,7 +5001,7 @@ diff -urN b/go/analysis/passes/testinggoroutine/BUILD.bazel c/go/analysis/passes + ], +) diff -urN b/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel c/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4812,7 +5022,7 @@ diff -urN b/go/analysis/passes/testinggoroutine/testdata/src/a/BUILD.bazel c/go/ + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4830,9 +5040,9 @@ diff -urN b/go/analysis/passes/testinggoroutine/testdata/src/typeparams/BUILD.ba + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/tests/BUILD.bazel c/go/analysis/passes/tests/BUILD.bazel ---- b/go/analysis/passes/tests/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4842,6 +5052,7 @@ diff -urN b/go/analysis/passes/tests/BUILD.bazel c/go/analysis/passes/tests/BUIL + visibility = ["//visibility:public"], + deps = [ + "//go/analysis", ++ "//internal/analysisinternal", + "//internal/typeparams", + ], +) @@ -4855,16 +5066,18 @@ diff -urN b/go/analysis/passes/tests/BUILD.bazel c/go/analysis/passes/tests/BUIL +go_test( + name = "tests_test", + srcs = ["tests_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":tests", + "//go/analysis/analysistest", ++ "//internal/analysisinternal", + "//internal/typeparams", + ], +) diff -urN b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel c/go/analysis/passes/tests/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,23 @@ +@@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4885,11 +5098,12 @@ diff -urN b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel c/go/analysis/pa + srcs = [ + "a_test.go", + "ax_test.go", ++ "go118_test.go", + ], + embed = [":a"], +) diff -urN b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel c/go/analysis/passes/tests/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -4907,7 +5121,7 @@ diff -urN b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel c/go/analysis/pa + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel c/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel ---- b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,6 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") @@ -4917,7 +5131,7 @@ diff -urN b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel c/go/anal + srcs = ["b_test.go"], +) diff -urN b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel c/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel ---- b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -4941,7 +5155,7 @@ diff -urN b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel c/go/ana + embed = [":divergent"], +) diff -urN b/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -4965,9 +5179,9 @@ diff -urN b/go/analysis/passes/tests/testdata/src/typeparams/BUILD.bazel c/go/an + embed = [":typeparams"], +) diff -urN b/go/analysis/passes/unmarshal/BUILD.bazel c/go/analysis/passes/unmarshal/BUILD.bazel ---- b/go/analysis/passes/unmarshal/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unmarshal/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unmarshal/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -4993,6 +5207,7 @@ diff -urN b/go/analysis/passes/unmarshal/BUILD.bazel c/go/analysis/passes/unmars +go_test( + name = "unmarshal_test", + srcs = ["unmarshal_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unmarshal", + "//go/analysis/analysistest", @@ -5000,7 +5215,7 @@ diff -urN b/go/analysis/passes/unmarshal/BUILD.bazel c/go/analysis/passes/unmars + ], +) diff -urN b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel c/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel ---- b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -5022,7 +5237,7 @@ diff -urN b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel c/go/analysis + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel c/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5040,7 +5255,7 @@ diff -urN b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel c/go/analysi + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5058,9 +5273,9 @@ diff -urN b/go/analysis/passes/unmarshal/testdata/src/typeparams/BUILD.bazel c/g + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unreachable/BUILD.bazel c/go/analysis/passes/unreachable/BUILD.bazel ---- b/go/analysis/passes/unreachable/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unreachable/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unreachable/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5084,13 +5299,14 @@ diff -urN b/go/analysis/passes/unreachable/BUILD.bazel c/go/analysis/passes/unre +go_test( + name = "unreachable_test", + srcs = ["unreachable_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unreachable", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel c/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5108,9 +5324,9 @@ diff -urN b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unsafeptr/BUILD.bazel c/go/analysis/passes/unsafeptr/BUILD.bazel ---- b/go/analysis/passes/unsafeptr/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unsafeptr/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unsafeptr/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5135,6 +5351,7 @@ diff -urN b/go/analysis/passes/unsafeptr/BUILD.bazel c/go/analysis/passes/unsafe +go_test( + name = "unsafeptr_test", + srcs = ["unsafeptr_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unsafeptr", + "//go/analysis/analysistest", @@ -5142,7 +5359,7 @@ diff -urN b/go/analysis/passes/unsafeptr/BUILD.bazel c/go/analysis/passes/unsafe + ], +) diff -urN b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel c/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5163,7 +5380,7 @@ diff -urN b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel c/go/analysi + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5181,9 +5398,9 @@ diff -urN b/go/analysis/passes/unsafeptr/testdata/src/typeparams/BUILD.bazel c/g + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unusedresult/BUILD.bazel c/go/analysis/passes/unusedresult/BUILD.bazel ---- b/go/analysis/passes/unusedresult/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedresult/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedresult/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5209,6 +5426,7 @@ diff -urN b/go/analysis/passes/unusedresult/BUILD.bazel c/go/analysis/passes/unu +go_test( + name = "unusedresult_test", + srcs = ["unusedresult_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unusedresult", + "//go/analysis/analysistest", @@ -5216,7 +5434,7 @@ diff -urN b/go/analysis/passes/unusedresult/BUILD.bazel c/go/analysis/passes/unu + ], +) diff -urN b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel c/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5234,7 +5452,7 @@ diff -urN b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel c/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel ---- b/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5252,7 +5470,7 @@ diff -urN b/go/analysis/passes/unusedresult/testdata/src/typeparams/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUILD.bazel c/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUILD.bazel ---- b/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5270,9 +5488,9 @@ diff -urN b/go/analysis/passes/unusedresult/testdata/src/typeparams/userdefs/BUI + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/unusedwrite/BUILD.bazel c/go/analysis/passes/unusedwrite/BUILD.bazel ---- b/go/analysis/passes/unusedwrite/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedwrite/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedwrite/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5296,13 +5514,14 @@ diff -urN b/go/analysis/passes/unusedwrite/BUILD.bazel c/go/analysis/passes/unus +go_test( + name = "unusedwrite_test", + srcs = ["unusedwrite_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unusedwrite", + "//go/analysis/analysistest", + ], +) diff -urN b/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel c/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5320,9 +5539,9 @@ diff -urN b/go/analysis/passes/unusedwrite/testdata/src/a/BUILD.bazel c/go/analy + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/usesgenerics/BUILD.bazel c/go/analysis/passes/usesgenerics/BUILD.bazel ---- b/go/analysis/passes/usesgenerics/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/usesgenerics/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/usesgenerics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5347,6 +5566,7 @@ diff -urN b/go/analysis/passes/usesgenerics/BUILD.bazel c/go/analysis/passes/use +go_test( + name = "usesgenerics_test", + srcs = ["usesgenerics_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":usesgenerics", + "//go/analysis/analysistest", @@ -5354,7 +5574,7 @@ diff -urN b/go/analysis/passes/usesgenerics/BUILD.bazel c/go/analysis/passes/use + ], +) diff -urN b/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel c/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel ---- b/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5372,7 +5592,7 @@ diff -urN b/go/analysis/passes/usesgenerics/testdata/src/a/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel c/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel ---- b/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5390,7 +5610,7 @@ diff -urN b/go/analysis/passes/usesgenerics/testdata/src/b/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel c/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel ---- b/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5408,7 +5628,7 @@ diff -urN b/go/analysis/passes/usesgenerics/testdata/src/c/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel c/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel ---- b/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5426,7 +5646,7 @@ diff -urN b/go/analysis/passes/usesgenerics/testdata/src/d/BUILD.bazel c/go/anal + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/singlechecker/BUILD.bazel c/go/analysis/singlechecker/BUILD.bazel ---- b/go/analysis/singlechecker/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/singlechecker/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/singlechecker/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5450,7 +5670,7 @@ diff -urN b/go/analysis/singlechecker/BUILD.bazel c/go/analysis/singlechecker/BU + visibility = ["//visibility:public"], +) diff -urN b/go/analysis/unitchecker/BUILD.bazel c/go/analysis/unitchecker/BUILD.bazel ---- b/go/analysis/unitchecker/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/analysis/unitchecker/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/analysis/unitchecker/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -5488,7 +5708,7 @@ diff -urN b/go/analysis/unitchecker/BUILD.bazel c/go/analysis/unitchecker/BUILD. + ], +) diff -urN b/go/ast/astutil/BUILD.bazel c/go/ast/astutil/BUILD.bazel ---- b/go/ast/astutil/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ast/astutil/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ast/astutil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -5523,7 +5743,7 @@ diff -urN b/go/ast/astutil/BUILD.bazel c/go/ast/astutil/BUILD.bazel + deps = ["//internal/typeparams"], +) diff -urN b/go/ast/inspector/BUILD.bazel c/go/ast/inspector/BUILD.bazel ---- b/go/ast/inspector/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ast/inspector/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ast/inspector/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -5554,7 +5774,7 @@ diff -urN b/go/ast/inspector/BUILD.bazel c/go/ast/inspector/BUILD.bazel + ], +) diff -urN b/go/buildutil/BUILD.bazel c/go/buildutil/BUILD.bazel ---- b/go/buildutil/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/buildutil/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/buildutil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -5593,7 +5813,7 @@ diff -urN b/go/buildutil/BUILD.bazel c/go/buildutil/BUILD.bazel + ], +) diff -urN b/go/callgraph/BUILD.bazel c/go/callgraph/BUILD.bazel ---- b/go/callgraph/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -5615,9 +5835,9 @@ diff -urN b/go/callgraph/BUILD.bazel c/go/callgraph/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/callgraph/cha/BUILD.bazel c/go/callgraph/cha/BUILD.bazel ---- b/go/callgraph/cha/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/cha/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/cha/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,106 @@ +@@ -0,0 +1,132 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5647,85 +5867,111 @@ diff -urN b/go/callgraph/cha/BUILD.bazel c/go/callgraph/cha/BUILD.bazel + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:ios": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:js": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:linux": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:windows": [ + ":cha", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "//conditions:default": [], + }), +) diff -urN b/go/callgraph/cha/testdata/BUILD.bazel c/go/callgraph/cha/testdata/BUILD.bazel ---- b/go/callgraph/cha/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/cha/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/cha/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -5743,9 +5989,9 @@ diff -urN b/go/callgraph/cha/testdata/BUILD.bazel c/go/callgraph/cha/testdata/BU + visibility = ["//visibility:public"], +) diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel ---- b/go/callgraph/rta/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/rta/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/rta/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,119 @@ +@@ -0,0 +1,132 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5777,6 +6023,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + ":rta", @@ -5784,6 +6031,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + ":rta", @@ -5791,6 +6039,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + ":rta", @@ -5798,6 +6047,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + ":rta", @@ -5805,6 +6055,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:ios": [ + ":rta", @@ -5812,6 +6063,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:js": [ + ":rta", @@ -5819,6 +6071,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:linux": [ + ":rta", @@ -5826,6 +6079,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + ":rta", @@ -5833,6 +6087,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + ":rta", @@ -5840,6 +6095,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + ":rta", @@ -5847,6 +6103,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + ":rta", @@ -5854,6 +6111,7 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:windows": [ + ":rta", @@ -5861,14 +6119,15 @@ diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], + "//conditions:default": [], + }), +) diff -urN b/go/callgraph/static/BUILD.bazel c/go/callgraph/static/BUILD.bazel ---- b/go/callgraph/static/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/static/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/static/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5896,13 +6155,15 @@ diff -urN b/go/callgraph/static/BUILD.bazel c/go/callgraph/static/BUILD.bazel + ":static", + "//go/callgraph", + "//go/loader", ++ "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], +) diff -urN b/go/callgraph/vta/BUILD.bazel c/go/callgraph/vta/BUILD.bazel ---- b/go/callgraph/vta/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/vta/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/vta/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,45 @@ +@@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -5940,16 +6201,20 @@ diff -urN b/go/callgraph/vta/BUILD.bazel c/go/callgraph/vta/BUILD.bazel + ], + embed = [":vta"], + deps = [ ++ "//go/analysis", ++ "//go/analysis/analysistest", ++ "//go/analysis/passes/buildssa", + "//go/callgraph", + "//go/callgraph/cha", + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", + "//go/types/typeutil", ++ "//internal/typeparams", + ], +) diff -urN b/go/callgraph/vta/internal/trie/BUILD.bazel c/go/callgraph/vta/internal/trie/BUILD.bazel ---- b/go/callgraph/vta/internal/trie/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/callgraph/vta/internal/trie/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/callgraph/vta/internal/trie/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -5981,22 +6246,24 @@ diff -urN b/go/callgraph/vta/internal/trie/BUILD.bazel c/go/callgraph/vta/intern + ], + embed = [":trie"], +) -diff -urN b/go/callgraph/vta/testdata/BUILD.bazel c/go/callgraph/vta/testdata/BUILD.bazel ---- b/go/callgraph/vta/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/go/callgraph/vta/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,44 @@ +diff -urN b/go/callgraph/vta/testdata/src/BUILD.bazel c/go/callgraph/vta/testdata/src/BUILD.bazel +--- b/go/callgraph/vta/testdata/src/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/callgraph/vta/testdata/src/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( -+ name = "testdata", ++ name = "src", + srcs = [ + "callgraph_collections.go", + "callgraph_field_funcs.go", + "callgraph_fields.go", ++ "callgraph_generics.go", + "callgraph_ho.go", + "callgraph_interfaces.go", + "callgraph_nested_ptr.go", + "callgraph_pointers.go", ++ "callgraph_recursive_types.go", + "callgraph_static.go", + "channels.go", + "closures.go", @@ -6020,17 +6287,53 @@ diff -urN b/go/callgraph/vta/testdata/BUILD.bazel c/go/callgraph/vta/testdata/BU + "type_assertions.go", + "type_conversions.go", + ], -+ importpath = "golang.org/x/tools/go/callgraph/vta/testdata", ++ importpath = "golang.org/x/tools/go/callgraph/vta/testdata/src", + visibility = ["//visibility:public"], +) + +alias( + name = "go_default_library", -+ actual = ":testdata", ++ actual = ":src", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/callgraph/vta/testdata/src/d/BUILD.bazel c/go/callgraph/vta/testdata/src/d/BUILD.bazel +--- b/go/callgraph/vta/testdata/src/d/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/callgraph/vta/testdata/src/d/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "d", ++ srcs = ["d.go"], ++ importpath = "golang.org/x/tools/go/callgraph/vta/testdata/src/d", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":d", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/callgraph/vta/testdata/src/t/BUILD.bazel c/go/callgraph/vta/testdata/src/t/BUILD.bazel +--- b/go/callgraph/vta/testdata/src/t/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/callgraph/vta/testdata/src/t/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "t", ++ srcs = ["t.go"], ++ importpath = "golang.org/x/tools/go/callgraph/vta/testdata/src/t", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":t", + visibility = ["//visibility:public"], +) diff -urN b/go/cfg/BUILD.bazel c/go/cfg/BUILD.bazel ---- b/go/cfg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/cfg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/cfg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6057,7 +6360,7 @@ diff -urN b/go/cfg/BUILD.bazel c/go/cfg/BUILD.bazel + embed = [":cfg"], +) diff -urN b/go/expect/BUILD.bazel c/go/expect/BUILD.bazel ---- b/go/expect/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/expect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/expect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6085,7 +6388,7 @@ diff -urN b/go/expect/BUILD.bazel c/go/expect/BUILD.bazel + deps = [":expect"], +) diff -urN b/go/expect/testdata/BUILD.bazel c/go/expect/testdata/BUILD.bazel ---- b/go/expect/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/expect/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/expect/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6103,7 +6406,7 @@ diff -urN b/go/expect/testdata/BUILD.bazel c/go/expect/testdata/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/gccgoexportdata/BUILD.bazel c/go/gccgoexportdata/BUILD.bazel ---- b/go/gccgoexportdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/gccgoexportdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/gccgoexportdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6129,7 +6432,7 @@ diff -urN b/go/gccgoexportdata/BUILD.bazel c/go/gccgoexportdata/BUILD.bazel + deps = [":gccgoexportdata"], +) diff -urN b/go/gcexportdata/BUILD.bazel c/go/gcexportdata/BUILD.bazel ---- b/go/gcexportdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/gcexportdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/gcexportdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6161,7 +6464,7 @@ diff -urN b/go/gcexportdata/BUILD.bazel c/go/gcexportdata/BUILD.bazel + deps = [":gcexportdata"], +) diff -urN b/go/internal/cgo/BUILD.bazel c/go/internal/cgo/BUILD.bazel ---- b/go/internal/cgo/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/internal/cgo/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/internal/cgo/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6183,7 +6486,7 @@ diff -urN b/go/internal/cgo/BUILD.bazel c/go/internal/cgo/BUILD.bazel + visibility = ["//go:__subpackages__"], +) diff -urN b/go/internal/gccgoimporter/BUILD.bazel c/go/internal/gccgoimporter/BUILD.bazel ---- b/go/internal/gccgoimporter/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/internal/gccgoimporter/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/internal/gccgoimporter/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6222,7 +6525,7 @@ diff -urN b/go/internal/gccgoimporter/BUILD.bazel c/go/internal/gccgoimporter/BU + embed = [":gccgoimporter"], +) diff -urN b/go/internal/gcimporter/BUILD.bazel c/go/internal/gcimporter/BUILD.bazel ---- b/go/internal/gcimporter/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/internal/gcimporter/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/internal/gcimporter/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6272,8 +6575,29 @@ diff -urN b/go/internal/gcimporter/BUILD.bazel c/go/internal/gcimporter/BUILD.ba + "//internal/typeparams/genericfeatures", + ], +) +diff -urN b/go/internal/gcimporter/testdata/issue51836/BUILD.bazel c/go/internal/gcimporter/testdata/issue51836/BUILD.bazel +--- b/go/internal/gcimporter/testdata/issue51836/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/internal/gcimporter/testdata/issue51836/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,17 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "issue51836", ++ srcs = [ ++ "a.go", ++ "aa.go", ++ ], ++ importpath = "golang.org/x/tools/go/internal/gcimporter/testdata/issue51836", ++ visibility = ["//go:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":issue51836", ++ visibility = ["//go:__subpackages__"], ++) diff -urN b/go/internal/gcimporter/testdata/versions/BUILD.bazel c/go/internal/gcimporter/testdata/versions/BUILD.bazel ---- b/go/internal/gcimporter/testdata/versions/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/internal/gcimporter/testdata/versions/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/internal/gcimporter/testdata/versions/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6291,7 +6615,7 @@ diff -urN b/go/internal/gcimporter/testdata/versions/BUILD.bazel c/go/internal/g + visibility = ["//go:__subpackages__"], +) diff -urN b/go/internal/packagesdriver/BUILD.bazel c/go/internal/packagesdriver/BUILD.bazel ---- b/go/internal/packagesdriver/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/internal/packagesdriver/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/internal/packagesdriver/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6310,9 +6634,9 @@ diff -urN b/go/internal/packagesdriver/BUILD.bazel c/go/internal/packagesdriver/ + visibility = ["//go:__subpackages__"], +) diff -urN b/go/loader/BUILD.bazel c/go/loader/BUILD.bazel ---- b/go/loader/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/loader/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/loader/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,36 @@ +@@ -0,0 +1,37 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -6328,6 +6652,7 @@ diff -urN b/go/loader/BUILD.bazel c/go/loader/BUILD.bazel + "//go/ast/astutil", + "//go/buildutil", + "//go/internal/cgo", ++ "//internal/typeparams", + ], +) + @@ -6350,7 +6675,7 @@ diff -urN b/go/loader/BUILD.bazel c/go/loader/BUILD.bazel + ], +) diff -urN b/go/loader/testdata/BUILD.bazel c/go/loader/testdata/BUILD.bazel ---- b/go/loader/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/loader/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/loader/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6372,7 +6697,7 @@ diff -urN b/go/loader/testdata/BUILD.bazel c/go/loader/testdata/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/loader/testdata/issue46877/BUILD.bazel c/go/loader/testdata/issue46877/BUILD.bazel ---- b/go/loader/testdata/issue46877/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/loader/testdata/issue46877/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/loader/testdata/issue46877/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6394,9 +6719,9 @@ diff -urN b/go/loader/testdata/issue46877/BUILD.bazel c/go/loader/testdata/issue + visibility = ["//visibility:public"], +) diff -urN b/go/packages/BUILD.bazel c/go/packages/BUILD.bazel ---- b/go/packages/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,48 @@ +@@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -6420,7 +6745,6 @@ diff -urN b/go/packages/BUILD.bazel c/go/packages/BUILD.bazel + "//internal/typeparams", + "//internal/typesinternal", + "@org_golang_x_sys//execabs:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -6446,7 +6770,7 @@ diff -urN b/go/packages/BUILD.bazel c/go/packages/BUILD.bazel + ], +) diff -urN b/go/packages/gopackages/BUILD.bazel c/go/packages/gopackages/BUILD.bazel ---- b/go/packages/gopackages/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/gopackages/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/gopackages/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -6469,9 +6793,9 @@ diff -urN b/go/packages/gopackages/BUILD.bazel c/go/packages/gopackages/BUILD.ba + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/BUILD.bazel c/go/packages/packagestest/BUILD.bazel ---- b/go/packages/packagestest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,46 @@ +@@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -6493,7 +6817,6 @@ diff -urN b/go/packages/packagestest/BUILD.bazel c/go/packages/packagestest/BUIL + "//internal/proxydir", + "//internal/span", + "//internal/testenv", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -6519,7 +6842,7 @@ diff -urN b/go/packages/packagestest/BUILD.bazel c/go/packages/packagestest/BUIL + ], +) diff -urN b/go/packages/packagestest/testdata/BUILD.bazel c/go/packages/packagestest/testdata/BUILD.bazel ---- b/go/packages/packagestest/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6546,7 +6869,7 @@ diff -urN b/go/packages/packagestest/testdata/BUILD.bazel c/go/packages/packages + embed = [":testdata"], +) diff -urN b/go/packages/packagestest/testdata/groups/one/modules/example.com/extra/BUILD.bazel c/go/packages/packagestest/testdata/groups/one/modules/example.com/extra/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/one/modules/example.com/extra/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/one/modules/example.com/extra/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/one/modules/example.com/extra/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6564,7 +6887,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/one/modules/example.com/ext + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel c/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6582,7 +6905,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/one/primarymod/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6600,7 +6923,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/ext + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/geez/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/geez/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/geez/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/geez/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/geez/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6618,7 +6941,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/ext + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6636,7 +6959,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/ext + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/geez/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/geez/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/geez/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/geez/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/extra/v2/geez/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6654,7 +6977,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/ext + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/tempmod/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/tempmod/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/tempmod/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/tempmod/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/tempmod/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6672,7 +6995,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/tem + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.0.0/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.0.0/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.0.0/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.0.0/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.0.0/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6690,7 +7013,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/wha + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.1.0/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.1.0/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.1.0/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.1.0/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/modules/example.com/what@v1.1.0/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6708,7 +7031,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/modules/example.com/wha + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -6726,7 +7049,7 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/primarymod/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD.bazel c/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD.bazel ---- b/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -6749,9 +7072,9 @@ diff -urN b/go/packages/packagestest/testdata/groups/two/primarymod/expect/BUILD + srcs = ["yo_test.go"], +) diff -urN b/go/pointer/BUILD.bazel c/go/pointer/BUILD.bazel ---- b/go/pointer/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/pointer/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/pointer/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,109 @@ +@@ -0,0 +1,122 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -6809,60 +7132,73 @@ diff -urN b/go/pointer/BUILD.bazel c/go/pointer/BUILD.bazel + "@io_bazel_rules_go//go/platform:aix": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "//go/packages", + "//go/types/typeutil", ++ "//internal/typeparams", + ], + "//conditions:default": [], + }), +) diff -urN b/go/pointer/testdata/BUILD.bazel c/go/pointer/testdata/BUILD.bazel ---- b/go/pointer/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/pointer/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/pointer/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -6884,14 +7220,15 @@ diff -urN b/go/pointer/testdata/BUILD.bazel c/go/pointer/testdata/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel ---- b/go/ssa/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,128 @@ +@@ -0,0 +1,139 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ssa", + srcs = [ ++ "block.go", + "blockopt.go", + "builder.go", + "const.go", @@ -6902,14 +7239,17 @@ diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel + "func.go", + "identical.go", + "identical_17.go", ++ "instantiate.go", + "lift.go", + "lvalue.go", + "methods.go", + "mode.go", ++ "parameterized.go", + "print.go", + "sanity.go", + "source.go", + "ssa.go", ++ "subst.go", + "util.go", + "wrappers.go", + ], @@ -6918,6 +7258,7 @@ diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel + deps = [ + "//go/ast/astutil", + "//go/types/typeutil", ++ "//internal/typeparams", + ], +) + @@ -6934,18 +7275,24 @@ diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel + "builder_test.go", + "example_test.go", + "identical_test.go", ++ "instantiate_test.go", ++ "methods_test.go", ++ "parameterized_test.go", + "source_test.go", + "stdlib_test.go", ++ "subst_test.go", + "testhelper_test.go", + ], + data = glob(["testdata/**"]), + embed = [":ssa"], + deps = [ + "//go/ast/astutil", ++ "//go/buildutil", + "//go/expect", + "//go/loader", + "//go/packages", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//go/ast/inspector", @@ -7016,9 +7363,9 @@ diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel + }), +) diff -urN b/go/ssa/interp/BUILD.bazel c/go/ssa/interp/BUILD.bazel ---- b/go/ssa/interp/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,39 @@ +@@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -7056,12 +7403,13 @@ diff -urN b/go/ssa/interp/BUILD.bazel c/go/ssa/interp/BUILD.bazel + "//go/loader", + "//go/ssa", + "//go/ssa/ssautil", ++ "//internal/typeparams", + ], +) diff -urN b/go/ssa/interp/testdata/BUILD.bazel c/go/ssa/interp/testdata/BUILD.bazel ---- b/go/ssa/interp/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( @@ -7069,7 +7417,9 @@ diff -urN b/go/ssa/interp/testdata/BUILD.bazel c/go/ssa/interp/testdata/BUILD.ba + srcs = [ + "boundmeth.go", + "complit.go", ++ "convert.go", + "coverage.go", ++ "deepequal.go", + "defer.go", + "fieldprom.go", + "ifaceconv.go", @@ -7082,6 +7432,7 @@ diff -urN b/go/ssa/interp/testdata/BUILD.bazel c/go/ssa/interp/testdata/BUILD.ba + "reflect.go", + "slice2arrayptr.go", + "static.go", ++ "width32.go", + ], + importpath = "golang.org/x/tools/go/ssa/interp/testdata", + visibility = ["//visibility:private"], @@ -7092,8 +7443,47 @@ diff -urN b/go/ssa/interp/testdata/BUILD.bazel c/go/ssa/interp/testdata/BUILD.ba + embed = [":testdata_lib"], + visibility = ["//visibility:public"], +) +diff -urN b/go/ssa/interp/testdata/fixedbugs/BUILD.bazel c/go/ssa/interp/testdata/fixedbugs/BUILD.bazel +--- b/go/ssa/interp/testdata/fixedbugs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/fixedbugs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,17 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") ++ ++go_library( ++ name = "fixedbugs_lib", ++ srcs = [ ++ "issue52342.go", ++ "issue52835.go", ++ ], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/fixedbugs", ++ visibility = ["//visibility:private"], ++) ++ ++go_binary( ++ name = "fixedbugs", ++ embed = [":fixedbugs_lib"], ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/interp/testdata/src/encoding/BUILD.bazel c/go/ssa/interp/testdata/src/encoding/BUILD.bazel +--- b/go/ssa/interp/testdata/src/encoding/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/encoding/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "encoding", ++ srcs = ["encoding.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/encoding", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":encoding", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/ssa/interp/testdata/src/errors/BUILD.bazel c/go/ssa/interp/testdata/src/errors/BUILD.bazel ---- b/go/ssa/interp/testdata/src/errors/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/errors/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/errors/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7111,7 +7501,7 @@ diff -urN b/go/ssa/interp/testdata/src/errors/BUILD.bazel c/go/ssa/interp/testda + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/fmt/BUILD.bazel c/go/ssa/interp/testdata/src/fmt/BUILD.bazel ---- b/go/ssa/interp/testdata/src/fmt/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/fmt/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/fmt/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7128,8 +7518,44 @@ diff -urN b/go/ssa/interp/testdata/src/fmt/BUILD.bazel c/go/ssa/interp/testdata/ + actual = ":fmt", + visibility = ["//visibility:public"], +) +diff -urN b/go/ssa/interp/testdata/src/io/BUILD.bazel c/go/ssa/interp/testdata/src/io/BUILD.bazel +--- b/go/ssa/interp/testdata/src/io/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/io/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "io", ++ srcs = ["io.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/io", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":io", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/interp/testdata/src/log/BUILD.bazel c/go/ssa/interp/testdata/src/log/BUILD.bazel +--- b/go/ssa/interp/testdata/src/log/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/log/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "log", ++ srcs = ["log.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/log", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":log", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/ssa/interp/testdata/src/math/BUILD.bazel c/go/ssa/interp/testdata/src/math/BUILD.bazel ---- b/go/ssa/interp/testdata/src/math/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/math/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/math/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7147,7 +7573,7 @@ diff -urN b/go/ssa/interp/testdata/src/math/BUILD.bazel c/go/ssa/interp/testdata + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/os/BUILD.bazel c/go/ssa/interp/testdata/src/os/BUILD.bazel ---- b/go/ssa/interp/testdata/src/os/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/os/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/os/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7165,14 +7591,17 @@ diff -urN b/go/ssa/interp/testdata/src/os/BUILD.bazel c/go/ssa/interp/testdata/s + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/reflect/BUILD.bazel c/go/ssa/interp/testdata/src/reflect/BUILD.bazel ---- b/go/ssa/interp/testdata/src/reflect/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/reflect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/reflect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,14 @@ +@@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "reflect", -+ srcs = ["reflect.go"], ++ srcs = [ ++ "deepequal.go", ++ "reflect.go", ++ ], + importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/reflect", + visibility = ["//visibility:public"], +) @@ -7183,7 +7612,7 @@ diff -urN b/go/ssa/interp/testdata/src/reflect/BUILD.bazel c/go/ssa/interp/testd + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/runtime/BUILD.bazel c/go/ssa/interp/testdata/src/runtime/BUILD.bazel ---- b/go/ssa/interp/testdata/src/runtime/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/runtime/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/runtime/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7200,8 +7629,44 @@ diff -urN b/go/ssa/interp/testdata/src/runtime/BUILD.bazel c/go/ssa/interp/testd + actual = ":runtime", + visibility = ["//visibility:public"], +) +diff -urN b/go/ssa/interp/testdata/src/sort/BUILD.bazel c/go/ssa/interp/testdata/src/sort/BUILD.bazel +--- b/go/ssa/interp/testdata/src/sort/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/sort/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "sort", ++ srcs = ["sort.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/sort", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":sort", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/interp/testdata/src/strconv/BUILD.bazel c/go/ssa/interp/testdata/src/strconv/BUILD.bazel +--- b/go/ssa/interp/testdata/src/strconv/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/strconv/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "strconv", ++ srcs = ["strconv.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/strconv", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":strconv", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/ssa/interp/testdata/src/strings/BUILD.bazel c/go/ssa/interp/testdata/src/strings/BUILD.bazel ---- b/go/ssa/interp/testdata/src/strings/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/strings/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/strings/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7218,8 +7683,26 @@ diff -urN b/go/ssa/interp/testdata/src/strings/BUILD.bazel c/go/ssa/interp/testd + actual = ":strings", + visibility = ["//visibility:public"], +) +diff -urN b/go/ssa/interp/testdata/src/sync/BUILD.bazel c/go/ssa/interp/testdata/src/sync/BUILD.bazel +--- b/go/ssa/interp/testdata/src/sync/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/interp/testdata/src/sync/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "sync", ++ srcs = ["sync.go"], ++ importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/sync", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":sync", ++ visibility = ["//visibility:public"], ++) diff -urN b/go/ssa/interp/testdata/src/time/BUILD.bazel c/go/ssa/interp/testdata/src/time/BUILD.bazel ---- b/go/ssa/interp/testdata/src/time/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/time/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/time/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7237,7 +7720,7 @@ diff -urN b/go/ssa/interp/testdata/src/time/BUILD.bazel c/go/ssa/interp/testdata + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel c/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel ---- b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7255,7 +7738,7 @@ diff -urN b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel c/go/ssa/interp/ + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel c/go/ssa/interp/testdata/src/unsafe/BUILD.bazel ---- b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/interp/testdata/src/unsafe/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7273,9 +7756,9 @@ diff -urN b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel c/go/ssa/interp/testda + visibility = ["//visibility:public"], +) diff -urN b/go/ssa/ssautil/BUILD.bazel c/go/ssa/ssautil/BUILD.bazel ---- b/go/ssa/ssautil/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/ssa/ssautil/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/ssa/ssautil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,91 @@ +@@ -0,0 +1,80 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -7291,6 +7774,7 @@ diff -urN b/go/ssa/ssautil/BUILD.bazel c/go/ssa/ssautil/BUILD.bazel + "//go/loader", + "//go/packages", + "//go/ssa", ++ "//internal/typeparams", + ], +) + @@ -7310,106 +7794,454 @@ diff -urN b/go/ssa/ssautil/BUILD.bazel c/go/ssa/ssautil/BUILD.bazel + deps = [ + ":ssautil", + "//go/packages", ++ "//go/ssa", + "//internal/testenv", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//go/loader", -+ "//go/ssa", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "//go/loader", -+ "//go/ssa", + ], + "//conditions:default": [], + }), +) -diff -urN b/go/types/objectpath/BUILD.bazel c/go/types/objectpath/BUILD.bazel ---- b/go/types/objectpath/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/go/types/objectpath/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +diff -urN b/go/ssa/testdata/src/bytes/BUILD.bazel c/go/ssa/testdata/src/bytes/BUILD.bazel +--- b/go/ssa/testdata/src/bytes/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/bytes/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( -+ name = "objectpath", -+ srcs = ["objectpath.go"], -+ importpath = "golang.org/x/tools/go/types/objectpath", ++ name = "bytes", ++ srcs = ["bytes.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/bytes", + visibility = ["//visibility:public"], -+ deps = ["//internal/typeparams"], +) + +alias( + name = "go_default_library", -+ actual = ":objectpath", ++ actual = ":bytes", + visibility = ["//visibility:public"], +) +diff -urN b/go/ssa/testdata/src/context/BUILD.bazel c/go/ssa/testdata/src/context/BUILD.bazel +--- b/go/ssa/testdata/src/context/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/context/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") + -+go_test( -+ name = "objectpath_test", -+ srcs = [ -+ "objectpath_go118_test.go", -+ "objectpath_test.go", -+ ], -+ deps = [ -+ ":objectpath", -+ "//go/buildutil", -+ "//go/gcexportdata", -+ "//go/loader", -+ ], ++go_library( ++ name = "context", ++ srcs = ["context.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/context", ++ visibility = ["//visibility:public"], +) -diff -urN b/go/types/typeutil/BUILD.bazel c/go/types/typeutil/BUILD.bazel ---- b/go/types/typeutil/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/go/types/typeutil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,39 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++alias( ++ name = "go_default_library", ++ actual = ":context", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/encoding/BUILD.bazel c/go/ssa/testdata/src/encoding/BUILD.bazel +--- b/go/ssa/testdata/src/encoding/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/encoding/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( -+ name = "typeutil", -+ srcs = [ -+ "callee.go", ++ name = "encoding", ++ srcs = ["encoding.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/encoding", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":encoding", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/encoding/json/BUILD.bazel c/go/ssa/testdata/src/encoding/json/BUILD.bazel +--- b/go/ssa/testdata/src/encoding/json/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/encoding/json/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "json", ++ srcs = ["json.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/encoding/json", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":json", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/encoding/xml/BUILD.bazel c/go/ssa/testdata/src/encoding/xml/BUILD.bazel +--- b/go/ssa/testdata/src/encoding/xml/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/encoding/xml/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "xml", ++ srcs = ["xml.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/encoding/xml", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":xml", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/errors/BUILD.bazel c/go/ssa/testdata/src/errors/BUILD.bazel +--- b/go/ssa/testdata/src/errors/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/errors/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "errors", ++ srcs = ["errors.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/errors", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":errors", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/fmt/BUILD.bazel c/go/ssa/testdata/src/fmt/BUILD.bazel +--- b/go/ssa/testdata/src/fmt/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/fmt/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "fmt", ++ srcs = ["fmt.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/fmt", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":fmt", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/io/BUILD.bazel c/go/ssa/testdata/src/io/BUILD.bazel +--- b/go/ssa/testdata/src/io/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/io/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "io", ++ srcs = ["io.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/io", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":io", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/log/BUILD.bazel c/go/ssa/testdata/src/log/BUILD.bazel +--- b/go/ssa/testdata/src/log/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/log/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "log", ++ srcs = ["log.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/log", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":log", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/math/BUILD.bazel c/go/ssa/testdata/src/math/BUILD.bazel +--- b/go/ssa/testdata/src/math/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/math/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "math", ++ srcs = ["math.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/math", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":math", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/os/BUILD.bazel c/go/ssa/testdata/src/os/BUILD.bazel +--- b/go/ssa/testdata/src/os/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/os/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "os", ++ srcs = ["os.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/os", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":os", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/reflect/BUILD.bazel c/go/ssa/testdata/src/reflect/BUILD.bazel +--- b/go/ssa/testdata/src/reflect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/reflect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "reflect", ++ srcs = ["reflect.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/reflect", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":reflect", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/runtime/BUILD.bazel c/go/ssa/testdata/src/runtime/BUILD.bazel +--- b/go/ssa/testdata/src/runtime/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/runtime/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "runtime", ++ srcs = ["runtime.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/runtime", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":runtime", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/sort/BUILD.bazel c/go/ssa/testdata/src/sort/BUILD.bazel +--- b/go/ssa/testdata/src/sort/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/sort/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "sort", ++ srcs = ["sort.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/sort", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":sort", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/strconv/BUILD.bazel c/go/ssa/testdata/src/strconv/BUILD.bazel +--- b/go/ssa/testdata/src/strconv/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/strconv/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "strconv", ++ srcs = ["strconv.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/strconv", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":strconv", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/strings/BUILD.bazel c/go/ssa/testdata/src/strings/BUILD.bazel +--- b/go/ssa/testdata/src/strings/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/strings/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "strings", ++ srcs = ["strings.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/strings", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":strings", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/sync/BUILD.bazel c/go/ssa/testdata/src/sync/BUILD.bazel +--- b/go/ssa/testdata/src/sync/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/sync/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "sync", ++ srcs = ["sync.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/sync", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":sync", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/sync/atomic/BUILD.bazel c/go/ssa/testdata/src/sync/atomic/BUILD.bazel +--- b/go/ssa/testdata/src/sync/atomic/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/sync/atomic/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "atomic", ++ srcs = ["atomic.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/sync/atomic", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":atomic", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/time/BUILD.bazel c/go/ssa/testdata/src/time/BUILD.bazel +--- b/go/ssa/testdata/src/time/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/time/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "time", ++ srcs = ["time.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/time", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":time", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/ssa/testdata/src/unsafe/BUILD.bazel c/go/ssa/testdata/src/unsafe/BUILD.bazel +--- b/go/ssa/testdata/src/unsafe/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/ssa/testdata/src/unsafe/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "unsafe", ++ srcs = ["unsafe.go"], ++ importpath = "golang.org/x/tools/go/ssa/testdata/src/unsafe", ++ visibility = ["//visibility:public"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":unsafe", ++ visibility = ["//visibility:public"], ++) +diff -urN b/go/types/objectpath/BUILD.bazel c/go/types/objectpath/BUILD.bazel +--- b/go/types/objectpath/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/types/objectpath/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,29 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "objectpath", ++ srcs = ["objectpath.go"], ++ importpath = "golang.org/x/tools/go/types/objectpath", ++ visibility = ["//visibility:public"], ++ deps = ["//internal/typeparams"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":objectpath", ++ visibility = ["//visibility:public"], ++) ++ ++go_test( ++ name = "objectpath_test", ++ srcs = [ ++ "objectpath_go118_test.go", ++ "objectpath_test.go", ++ ], ++ deps = [ ++ ":objectpath", ++ "//go/buildutil", ++ "//go/gcexportdata", ++ "//go/loader", ++ ], ++) +diff -urN b/go/types/typeutil/BUILD.bazel c/go/types/typeutil/BUILD.bazel +--- b/go/types/typeutil/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/go/types/typeutil/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,39 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "typeutil", ++ srcs = [ ++ "callee.go", + "imports.go", + "map.go", + "methodsetcache.go", @@ -7444,7 +8276,7 @@ diff -urN b/go/types/typeutil/BUILD.bazel c/go/types/typeutil/BUILD.bazel + ], +) diff -urN b/go/vcs/BUILD.bazel c/go/vcs/BUILD.bazel ---- b/go/vcs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/go/vcs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/go/vcs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7474,7 +8306,7 @@ diff -urN b/go/vcs/BUILD.bazel c/go/vcs/BUILD.bazel + embed = [":vcs"], +) diff -urN b/godoc/BUILD.bazel c/godoc/BUILD.bazel ---- b/godoc/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,64 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7542,7 +8374,7 @@ diff -urN b/godoc/BUILD.bazel c/godoc/BUILD.bazel + ], +) diff -urN b/godoc/analysis/BUILD.bazel c/godoc/analysis/BUILD.bazel ---- b/godoc/analysis/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/analysis/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/analysis/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7563,7 +8395,7 @@ diff -urN b/godoc/analysis/BUILD.bazel c/godoc/analysis/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/godoc/redirect/BUILD.bazel c/godoc/redirect/BUILD.bazel ---- b/godoc/redirect/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/redirect/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/redirect/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7592,7 +8424,7 @@ diff -urN b/godoc/redirect/BUILD.bazel c/godoc/redirect/BUILD.bazel + embed = [":redirect"], +) diff -urN b/godoc/static/BUILD.bazel c/godoc/static/BUILD.bazel ---- b/godoc/static/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/static/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/static/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7620,7 +8452,7 @@ diff -urN b/godoc/static/BUILD.bazel c/godoc/static/BUILD.bazel + embed = [":static"], +) diff -urN b/godoc/util/BUILD.bazel c/godoc/util/BUILD.bazel ---- b/godoc/util/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/util/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/util/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7642,7 +8474,7 @@ diff -urN b/godoc/util/BUILD.bazel c/godoc/util/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/godoc/vfs/BUILD.bazel c/godoc/vfs/BUILD.bazel ---- b/godoc/vfs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/vfs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/vfs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7678,7 +8510,7 @@ diff -urN b/godoc/vfs/BUILD.bazel c/godoc/vfs/BUILD.bazel + ], +) diff -urN b/godoc/vfs/gatefs/BUILD.bazel c/godoc/vfs/gatefs/BUILD.bazel ---- b/godoc/vfs/gatefs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/vfs/gatefs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/vfs/gatefs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7706,7 +8538,7 @@ diff -urN b/godoc/vfs/gatefs/BUILD.bazel c/godoc/vfs/gatefs/BUILD.bazel + ], +) diff -urN b/godoc/vfs/httpfs/BUILD.bazel c/godoc/vfs/httpfs/BUILD.bazel ---- b/godoc/vfs/httpfs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/vfs/httpfs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/vfs/httpfs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7725,7 +8557,7 @@ diff -urN b/godoc/vfs/httpfs/BUILD.bazel c/godoc/vfs/httpfs/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/godoc/vfs/mapfs/BUILD.bazel c/godoc/vfs/mapfs/BUILD.bazel ---- b/godoc/vfs/mapfs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/vfs/mapfs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/vfs/mapfs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7750,7 +8582,7 @@ diff -urN b/godoc/vfs/mapfs/BUILD.bazel c/godoc/vfs/mapfs/BUILD.bazel + embed = [":mapfs"], +) diff -urN b/godoc/vfs/zipfs/BUILD.bazel c/godoc/vfs/zipfs/BUILD.bazel ---- b/godoc/vfs/zipfs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/godoc/vfs/zipfs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/godoc/vfs/zipfs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7776,7 +8608,7 @@ diff -urN b/godoc/vfs/zipfs/BUILD.bazel c/godoc/vfs/zipfs/BUILD.bazel + deps = ["//godoc/vfs"], +) diff -urN b/imports/BUILD.bazel c/imports/BUILD.bazel ---- b/imports/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/imports/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/imports/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7798,9 +8630,9 @@ diff -urN b/imports/BUILD.bazel c/imports/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/internal/analysisinternal/BUILD.bazel c/internal/analysisinternal/BUILD.bazel ---- b/internal/analysisinternal/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/analysisinternal/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/analysisinternal/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,18 @@ +@@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -7808,10 +8640,7 @@ diff -urN b/internal/analysisinternal/BUILD.bazel c/internal/analysisinternal/BU + srcs = ["analysis.go"], + importpath = "golang.org/x/tools/internal/analysisinternal", + visibility = ["//:__subpackages__"], -+ deps = [ -+ "//go/ast/astutil", -+ "//internal/lsp/fuzzy", -+ ], ++ deps = ["//internal/lsp/fuzzy"], +) + +alias( @@ -7820,7 +8649,7 @@ diff -urN b/internal/analysisinternal/BUILD.bazel c/internal/analysisinternal/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/apidiff/BUILD.bazel c/internal/apidiff/BUILD.bazel ---- b/internal/apidiff/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/apidiff/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/apidiff/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7854,7 +8683,7 @@ diff -urN b/internal/apidiff/BUILD.bazel c/internal/apidiff/BUILD.bazel + ], +) diff -urN b/internal/apidiff/testdata/BUILD.bazel c/internal/apidiff/testdata/BUILD.bazel ---- b/internal/apidiff/testdata/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/apidiff/testdata/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/apidiff/testdata/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7872,7 +8701,7 @@ diff -urN b/internal/apidiff/testdata/BUILD.bazel c/internal/apidiff/testdata/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/apidiff/testdata/exported_fields/BUILD.bazel c/internal/apidiff/testdata/exported_fields/BUILD.bazel ---- b/internal/apidiff/testdata/exported_fields/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/apidiff/testdata/exported_fields/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/apidiff/testdata/exported_fields/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7890,7 +8719,7 @@ diff -urN b/internal/apidiff/testdata/exported_fields/BUILD.bazel c/internal/api + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/BUILD.bazel c/internal/event/BUILD.bazel ---- b/internal/event/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7928,7 +8757,7 @@ diff -urN b/internal/event/BUILD.bazel c/internal/event/BUILD.bazel + ], +) diff -urN b/internal/event/core/BUILD.bazel c/internal/event/core/BUILD.bazel ---- b/internal/event/core/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/core/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/core/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -7954,7 +8783,7 @@ diff -urN b/internal/event/core/BUILD.bazel c/internal/event/core/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/export/BUILD.bazel c/internal/event/export/BUILD.bazel ---- b/internal/event/export/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -7996,7 +8825,7 @@ diff -urN b/internal/event/export/BUILD.bazel c/internal/event/export/BUILD.baze + ], +) diff -urN b/internal/event/export/eventtest/BUILD.bazel c/internal/event/export/eventtest/BUILD.bazel ---- b/internal/event/export/eventtest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/eventtest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/eventtest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8020,7 +8849,7 @@ diff -urN b/internal/event/export/eventtest/BUILD.bazel c/internal/event/export/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/export/metric/BUILD.bazel c/internal/event/export/metric/BUILD.bazel ---- b/internal/event/export/metric/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/metric/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/metric/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8048,7 +8877,7 @@ diff -urN b/internal/event/export/metric/BUILD.bazel c/internal/event/export/met + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/export/ocagent/BUILD.bazel c/internal/event/export/ocagent/BUILD.bazel ---- b/internal/event/export/ocagent/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/ocagent/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/ocagent/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8096,7 +8925,7 @@ diff -urN b/internal/event/export/ocagent/BUILD.bazel c/internal/event/export/oc + ], +) diff -urN b/internal/event/export/ocagent/wire/BUILD.bazel c/internal/event/export/ocagent/wire/BUILD.bazel ---- b/internal/event/export/ocagent/wire/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/ocagent/wire/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/ocagent/wire/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8125,7 +8954,7 @@ diff -urN b/internal/event/export/ocagent/wire/BUILD.bazel c/internal/event/expo + embed = [":wire"], +) diff -urN b/internal/event/export/prometheus/BUILD.bazel c/internal/event/export/prometheus/BUILD.bazel ---- b/internal/event/export/prometheus/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/export/prometheus/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/export/prometheus/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8149,7 +8978,7 @@ diff -urN b/internal/event/export/prometheus/BUILD.bazel c/internal/event/export + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/keys/BUILD.bazel c/internal/event/keys/BUILD.bazel ---- b/internal/event/keys/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/keys/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/keys/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8171,7 +9000,7 @@ diff -urN b/internal/event/keys/BUILD.bazel c/internal/event/keys/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/event/label/BUILD.bazel c/internal/event/label/BUILD.bazel ---- b/internal/event/label/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/event/label/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/event/label/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8198,7 +9027,7 @@ diff -urN b/internal/event/label/BUILD.bazel c/internal/event/label/BUILD.bazel + ], +) diff -urN b/internal/fakenet/BUILD.bazel c/internal/fakenet/BUILD.bazel ---- b/internal/fakenet/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/fakenet/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/fakenet/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8216,7 +9045,7 @@ diff -urN b/internal/fakenet/BUILD.bazel c/internal/fakenet/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/fastwalk/BUILD.bazel c/internal/fastwalk/BUILD.bazel ---- b/internal/fastwalk/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/fastwalk/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/fastwalk/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8248,7 +9077,7 @@ diff -urN b/internal/fastwalk/BUILD.bazel c/internal/fastwalk/BUILD.bazel + deps = [":fastwalk"], +) diff -urN b/internal/gocommand/BUILD.bazel c/internal/gocommand/BUILD.bazel ---- b/internal/gocommand/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/gocommand/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/gocommand/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8281,7 +9110,7 @@ diff -urN b/internal/gocommand/BUILD.bazel c/internal/gocommand/BUILD.bazel + deps = [":gocommand"], +) diff -urN b/internal/gopathwalk/BUILD.bazel c/internal/gopathwalk/BUILD.bazel ---- b/internal/gopathwalk/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/gopathwalk/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/gopathwalk/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8306,7 +9135,7 @@ diff -urN b/internal/gopathwalk/BUILD.bazel c/internal/gopathwalk/BUILD.bazel + embed = [":gopathwalk"], +) diff -urN b/internal/imports/BUILD.bazel c/internal/imports/BUILD.bazel ---- b/internal/imports/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/imports/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/imports/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,48 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8358,9 +9187,9 @@ diff -urN b/internal/imports/BUILD.bazel c/internal/imports/BUILD.bazel + ], +) diff -urN b/internal/jsonrpc2/BUILD.bazel c/internal/jsonrpc2/BUILD.bazel ---- b/internal/jsonrpc2/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/jsonrpc2/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/jsonrpc2/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,42 @@ +@@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8380,7 +9209,6 @@ diff -urN b/internal/jsonrpc2/BUILD.bazel c/internal/jsonrpc2/BUILD.bazel + "//internal/event", + "//internal/event/label", + "//internal/lsp/debug/tag", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -8404,7 +9232,7 @@ diff -urN b/internal/jsonrpc2/BUILD.bazel c/internal/jsonrpc2/BUILD.bazel + ], +) diff -urN b/internal/jsonrpc2/servertest/BUILD.bazel c/internal/jsonrpc2/servertest/BUILD.bazel ---- b/internal/jsonrpc2/servertest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/jsonrpc2/servertest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/jsonrpc2/servertest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -8430,9 +9258,9 @@ diff -urN b/internal/jsonrpc2/servertest/BUILD.bazel c/internal/jsonrpc2/servert + deps = ["//internal/jsonrpc2"], +) diff -urN b/internal/jsonrpc2_v2/BUILD.bazel c/internal/jsonrpc2_v2/BUILD.bazel ---- b/internal/jsonrpc2_v2/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/jsonrpc2_v2/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/jsonrpc2_v2/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,43 @@ +@@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8452,7 +9280,6 @@ diff -urN b/internal/jsonrpc2_v2/BUILD.bazel c/internal/jsonrpc2_v2/BUILD.bazel + "//internal/event", + "//internal/event/label", + "//internal/lsp/debug/tag", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -8473,13 +9300,12 @@ diff -urN b/internal/jsonrpc2_v2/BUILD.bazel c/internal/jsonrpc2_v2/BUILD.bazel + ":jsonrpc2_v2", + "//internal/event/export/eventtest", + "//internal/stack/stacktest", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) diff -urN b/internal/lsp/BUILD.bazel c/internal/lsp/BUILD.bazel ---- b/internal/lsp/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,82 @@ +@@ -0,0 +1,88 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8514,25 +9340,30 @@ diff -urN b/internal/lsp/BUILD.bazel c/internal/lsp/BUILD.bazel + importpath = "golang.org/x/tools/internal/lsp", + visibility = ["//:__subpackages__"], + deps = [ ++ "//go/ast/astutil", ++ "//go/packages", + "//internal/event", + "//internal/gocommand", + "//internal/imports", + "//internal/jsonrpc2", ++ "//internal/lsp/bug", + "//internal/lsp/command", + "//internal/lsp/debug", + "//internal/lsp/debug/log", + "//internal/lsp/debug/tag", ++ "//internal/lsp/lsppos", + "//internal/lsp/mod", + "//internal/lsp/progress", + "//internal/lsp/protocol", ++ "//internal/lsp/safetoken", + "//internal/lsp/source", + "//internal/lsp/source/completion", + "//internal/lsp/template", ++ "//internal/lsp/work", + "//internal/span", + "//internal/typeparams", + "//internal/xcontext", + "@org_golang_x_mod//modfile:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -8551,6 +9382,7 @@ diff -urN b/internal/lsp/BUILD.bazel c/internal/lsp/BUILD.bazel + ], + embed = [":lsp"], + deps = [ ++ "//internal/lsp/bug", + "//internal/lsp/cache", + "//internal/lsp/command", + "//internal/lsp/diff", @@ -8562,10 +9394,62 @@ diff -urN b/internal/lsp/BUILD.bazel c/internal/lsp/BUILD.bazel + "//internal/testenv", + ], +) +diff -urN b/internal/lsp/analysis/embeddirective/BUILD.bazel c/internal/lsp/analysis/embeddirective/BUILD.bazel +--- b/internal/lsp/analysis/embeddirective/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/analysis/embeddirective/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "embeddirective", ++ srcs = ["embeddirective.go"], ++ importpath = "golang.org/x/tools/internal/lsp/analysis/embeddirective", ++ visibility = ["//:__subpackages__"], ++ deps = ["//go/analysis"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":embeddirective", ++ visibility = ["//:__subpackages__"], ++) ++ ++go_test( ++ name = "embeddirective_test", ++ srcs = ["embeddirective_test.go"], ++ data = glob(["testdata/**"]), ++ embed = [":embeddirective"], ++ deps = [ ++ "//go/analysis/analysistest", ++ "//internal/typeparams", ++ ], ++) +diff -urN b/internal/lsp/analysis/embeddirective/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/embeddirective/testdata/src/a/BUILD.bazel +--- b/internal/lsp/analysis/embeddirective/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/analysis/embeddirective/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,18 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "a", ++ srcs = [ ++ "a.go", ++ "b.go", ++ ], ++ embedsrcs = ["embedText"], ++ importpath = "golang.org/x/tools/internal/lsp/analysis/embeddirective/testdata/src/a", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":a", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/analysis/fillreturns/BUILD.bazel c/internal/lsp/analysis/fillreturns/BUILD.bazel ---- b/internal/lsp/analysis/fillreturns/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillreturns/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillreturns/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8590,6 +9474,7 @@ diff -urN b/internal/lsp/analysis/fillreturns/BUILD.bazel c/internal/lsp/analysi +go_test( + name = "fillreturns_test", + srcs = ["fillreturns_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":fillreturns", + "//go/analysis/analysistest", @@ -8597,7 +9482,7 @@ diff -urN b/internal/lsp/analysis/fillreturns/BUILD.bazel c/internal/lsp/analysi + ], +) diff -urN b/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8615,7 +9500,7 @@ diff -urN b/internal/lsp/analysis/fillreturns/testdata/src/a/BUILD.bazel c/inter + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.bazel c/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8633,9 +9518,9 @@ diff -urN b/internal/lsp/analysis/fillreturns/testdata/src/a/typeparams/BUILD.ba + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/fillstruct/BUILD.bazel c/internal/lsp/analysis/fillstruct/BUILD.bazel ---- b/internal/lsp/analysis/fillstruct/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillstruct/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillstruct/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,33 @@ +@@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8663,6 +9548,7 @@ diff -urN b/internal/lsp/analysis/fillstruct/BUILD.bazel c/internal/lsp/analysis +go_test( + name = "fillstruct_test", + srcs = ["fillstruct_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":fillstruct", + "//go/analysis/analysistest", @@ -8670,7 +9556,7 @@ diff -urN b/internal/lsp/analysis/fillstruct/BUILD.bazel c/internal/lsp/analysis + ], +) diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8688,7 +9574,7 @@ diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/a/BUILD.bazel c/intern + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel c/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel ---- b/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8706,7 +9592,7 @@ diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/b/BUILD.bazel c/intern + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel c/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8724,9 +9610,9 @@ diff -urN b/internal/lsp/analysis/fillstruct/testdata/src/typeparams/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/infertypeargs/BUILD.bazel c/internal/lsp/analysis/infertypeargs/BUILD.bazel ---- b/internal/lsp/analysis/infertypeargs/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/infertypeargs/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/infertypeargs/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,35 @@ +@@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8755,6 +9641,7 @@ diff -urN b/internal/lsp/analysis/infertypeargs/BUILD.bazel c/internal/lsp/analy +go_test( + name = "infertypeargs_test", + srcs = ["infertypeargs_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":infertypeargs", + "//go/analysis/analysistest", @@ -8763,7 +9650,7 @@ diff -urN b/internal/lsp/analysis/infertypeargs/BUILD.bazel c/internal/lsp/analy + ], +) diff -urN b/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8785,7 +9672,7 @@ diff -urN b/internal/lsp/analysis/infertypeargs/testdata/src/a/BUILD.bazel c/int + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.bazel c/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.bazel ---- b/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8803,9 +9690,9 @@ diff -urN b/internal/lsp/analysis/infertypeargs/testdata/src/a/imported/BUILD.ba + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/nonewvars/BUILD.bazel c/internal/lsp/analysis/nonewvars/BUILD.bazel ---- b/internal/lsp/analysis/nonewvars/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/nonewvars/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/nonewvars/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8830,6 +9717,7 @@ diff -urN b/internal/lsp/analysis/nonewvars/BUILD.bazel c/internal/lsp/analysis/ +go_test( + name = "nonewvars_test", + srcs = ["nonewvars_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":nonewvars", + "//go/analysis/analysistest", @@ -8837,7 +9725,7 @@ diff -urN b/internal/lsp/analysis/nonewvars/BUILD.bazel c/internal/lsp/analysis/ + ], +) diff -urN b/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8855,7 +9743,7 @@ diff -urN b/internal/lsp/analysis/nonewvars/testdata/src/a/BUILD.bazel c/interna + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel c/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8873,9 +9761,9 @@ diff -urN b/internal/lsp/analysis/nonewvars/testdata/src/typeparams/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/noresultvalues/BUILD.bazel c/internal/lsp/analysis/noresultvalues/BUILD.bazel ---- b/internal/lsp/analysis/noresultvalues/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/noresultvalues/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/noresultvalues/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8900,6 +9788,7 @@ diff -urN b/internal/lsp/analysis/noresultvalues/BUILD.bazel c/internal/lsp/anal +go_test( + name = "noresultvalues_test", + srcs = ["noresultvalues_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":noresultvalues", + "//go/analysis/analysistest", @@ -8907,7 +9796,7 @@ diff -urN b/internal/lsp/analysis/noresultvalues/BUILD.bazel c/internal/lsp/anal + ], +) diff -urN b/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8925,7 +9814,7 @@ diff -urN b/internal/lsp/analysis/noresultvalues/testdata/src/a/BUILD.bazel c/in + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.bazel c/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8943,9 +9832,9 @@ diff -urN b/internal/lsp/analysis/noresultvalues/testdata/src/typeparams/BUILD.b + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/simplifycompositelit/BUILD.bazel c/internal/lsp/analysis/simplifycompositelit/BUILD.bazel ---- b/internal/lsp/analysis/simplifycompositelit/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifycompositelit/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifycompositelit/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -8969,13 +9858,14 @@ diff -urN b/internal/lsp/analysis/simplifycompositelit/BUILD.bazel c/internal/ls +go_test( + name = "simplifycompositelit_test", + srcs = ["simplifycompositelit_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":simplifycompositelit", + "//go/analysis/analysistest", + ], +) diff -urN b/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -8993,9 +9883,9 @@ diff -urN b/internal/lsp/analysis/simplifycompositelit/testdata/src/a/BUILD.baze + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/simplifyrange/BUILD.bazel c/internal/lsp/analysis/simplifyrange/BUILD.bazel ---- b/internal/lsp/analysis/simplifyrange/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifyrange/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifyrange/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9019,13 +9909,14 @@ diff -urN b/internal/lsp/analysis/simplifyrange/BUILD.bazel c/internal/lsp/analy +go_test( + name = "simplifyrange_test", + srcs = ["simplifyrange_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":simplifyrange", + "//go/analysis/analysistest", + ], +) diff -urN b/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9043,9 +9934,9 @@ diff -urN b/internal/lsp/analysis/simplifyrange/testdata/src/a/BUILD.bazel c/int + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/simplifyslice/BUILD.bazel c/internal/lsp/analysis/simplifyslice/BUILD.bazel ---- b/internal/lsp/analysis/simplifyslice/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifyslice/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifyslice/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9069,6 +9960,7 @@ diff -urN b/internal/lsp/analysis/simplifyslice/BUILD.bazel c/internal/lsp/analy +go_test( + name = "simplifyslice_test", + srcs = ["simplifyslice_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":simplifyslice", + "//go/analysis/analysistest", @@ -9076,7 +9968,7 @@ diff -urN b/internal/lsp/analysis/simplifyslice/BUILD.bazel c/internal/lsp/analy + ], +) diff -urN b/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9094,7 +9986,7 @@ diff -urN b/internal/lsp/analysis/simplifyslice/testdata/src/a/BUILD.bazel c/int + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.bazel c/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9111,10 +10003,35 @@ diff -urN b/internal/lsp/analysis/simplifyslice/testdata/src/typeparams/BUILD.ba + actual = ":typeparams", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/analysis/stubmethods/BUILD.bazel c/internal/lsp/analysis/stubmethods/BUILD.bazel +--- b/internal/lsp/analysis/stubmethods/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/analysis/stubmethods/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,21 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "stubmethods", ++ srcs = ["stubmethods.go"], ++ importpath = "golang.org/x/tools/internal/lsp/analysis/stubmethods", ++ visibility = ["//:__subpackages__"], ++ deps = [ ++ "//go/analysis", ++ "//go/analysis/passes/inspect", ++ "//go/ast/astutil", ++ "//internal/analysisinternal", ++ "//internal/typesinternal", ++ ], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":stubmethods", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/analysis/undeclaredname/BUILD.bazel c/internal/lsp/analysis/undeclaredname/BUILD.bazel ---- b/internal/lsp/analysis/undeclaredname/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/undeclaredname/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/undeclaredname/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9139,13 +10056,14 @@ diff -urN b/internal/lsp/analysis/undeclaredname/BUILD.bazel c/internal/lsp/anal +go_test( + name = "undeclaredname_test", + srcs = ["undeclared_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":undeclaredname", + "//go/analysis/analysistest", + ], +) diff -urN b/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9174,9 +10092,9 @@ diff -urN b/internal/lsp/analysis/undeclaredname/testdata/src/a/BUILD.bazel c/in + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/unusedparams/BUILD.bazel c/internal/lsp/analysis/unusedparams/BUILD.bazel ---- b/internal/lsp/analysis/unusedparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/unusedparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/unusedparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,29 @@ +@@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9200,6 +10118,7 @@ diff -urN b/internal/lsp/analysis/unusedparams/BUILD.bazel c/internal/lsp/analys +go_test( + name = "unusedparams_test", + srcs = ["unusedparams_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":unusedparams", + "//go/analysis/analysistest", @@ -9207,7 +10126,7 @@ diff -urN b/internal/lsp/analysis/unusedparams/BUILD.bazel c/internal/lsp/analys + ], +) diff -urN b/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9225,7 +10144,7 @@ diff -urN b/internal/lsp/analysis/unusedparams/testdata/src/a/BUILD.bazel c/inte + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.bazel c/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.bazel ---- b/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9243,9 +10162,9 @@ diff -urN b/internal/lsp/analysis/unusedparams/testdata/src/typeparams/BUILD.baz + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/analysis/useany/BUILD.bazel c/internal/lsp/analysis/useany/BUILD.bazel ---- b/internal/lsp/analysis/useany/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/useany/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/useany/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9270,6 +10189,7 @@ diff -urN b/internal/lsp/analysis/useany/BUILD.bazel c/internal/lsp/analysis/use +go_test( + name = "useany_test", + srcs = ["useany_test.go"], ++ data = glob(["testdata/**"]), + deps = [ + ":useany", + "//go/analysis/analysistest", @@ -9277,7 +10197,7 @@ diff -urN b/internal/lsp/analysis/useany/BUILD.bazel c/internal/lsp/analysis/use + ], +) diff -urN b/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel c/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel ---- b/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9295,7 +10215,7 @@ diff -urN b/internal/lsp/analysis/useany/testdata/src/a/BUILD.bazel c/internal/l + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/browser/BUILD.bazel c/internal/lsp/browser/BUILD.bazel ---- b/internal/lsp/browser/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/browser/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/browser/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9313,10 +10233,34 @@ diff -urN b/internal/lsp/browser/BUILD.bazel c/internal/lsp/browser/BUILD.bazel + actual = ":browser", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/bug/BUILD.bazel c/internal/lsp/bug/BUILD.bazel +--- b/internal/lsp/bug/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/bug/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,20 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "bug", ++ srcs = ["bug.go"], ++ importpath = "golang.org/x/tools/internal/lsp/bug", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":bug", ++ visibility = ["//:__subpackages__"], ++) ++ ++go_test( ++ name = "bug_test", ++ srcs = ["bug_test.go"], ++ embed = [":bug"], ++) diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel ---- b/internal/lsp/cache/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/cache/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/cache/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,83 @@ +@@ -0,0 +1,88 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9326,6 +10270,7 @@ diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel + "cache.go", + "check.go", + "errors.go", ++ "graph.go", + "imports.go", + "keys.go", + "load.go", @@ -9335,6 +10280,8 @@ diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel + "os_darwin.go", + "os_windows.go", + "parse.go", ++ "parsemode_go116.go", ++ "parsemode_go117.go", + "pkg.go", + "session.go", + "snapshot.go", @@ -9354,16 +10301,18 @@ diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel + "//internal/event/label", + "//internal/gocommand", + "//internal/imports", ++ "//internal/lsp/bug", + "//internal/lsp/command", + "//internal/lsp/debug/log", + "//internal/lsp/debug/tag", + "//internal/lsp/diff", + "//internal/lsp/diff/myers", ++ "//internal/lsp/lsppos", + "//internal/lsp/progress", + "//internal/lsp/protocol", ++ "//internal/lsp/safetoken", + "//internal/lsp/source", + "//internal/memoize", -+ "//internal/mod/modfile", + "//internal/packagesinternal", + "//internal/span", + "//internal/typeparams", @@ -9374,7 +10323,6 @@ diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel + "@org_golang_x_mod//semver:go_default_library", + "@org_golang_x_sync//errgroup:go_default_library", + "@org_golang_x_sys//execabs:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -9398,12 +10346,13 @@ diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel + "//internal/lsp/fake", + "//internal/lsp/source", + "//internal/span", ++ "@org_golang_x_mod//modfile:go_default_library", + ], +) diff -urN b/internal/lsp/cmd/BUILD.bazel c/internal/lsp/cmd/BUILD.bazel ---- b/internal/lsp/cmd/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/cmd/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/cmd/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,74 @@ +@@ -0,0 +1,77 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9430,12 +10379,14 @@ diff -urN b/internal/lsp/cmd/BUILD.bazel c/internal/lsp/cmd/BUILD.bazel + "subcommands.go", + "suggested_fix.go", + "symbols.go", ++ "vulncheck.go", + "workspace.go", + "workspace_symbol.go", + ], + importpath = "golang.org/x/tools/internal/lsp/cmd", + visibility = ["//:__subpackages__"], + deps = [ ++ "//go/packages", + "//internal/fakenet", + "//internal/jsonrpc2", + "//internal/lsp", @@ -9450,7 +10401,6 @@ diff -urN b/internal/lsp/cmd/BUILD.bazel c/internal/lsp/cmd/BUILD.bazel + "//internal/span", + "//internal/tool", + "//internal/xcontext", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -9466,20 +10416,22 @@ diff -urN b/internal/lsp/cmd/BUILD.bazel c/internal/lsp/cmd/BUILD.bazel + "capabilities_test.go", + "cmd_test.go", + "export_test.go", ++ "help_test.go", + ], + embed = [":cmd"], + deps = [ + "//internal/lsp", ++ "//internal/lsp/bug", + "//internal/lsp/cache", + "//internal/lsp/cmd/test", + "//internal/lsp/protocol", + "//internal/lsp/tests", + "//internal/testenv", -+ "@org_golang_x_xerrors//:go_default_library", ++ "//internal/tool", + ], +) diff -urN b/internal/lsp/cmd/test/BUILD.bazel c/internal/lsp/cmd/test/BUILD.bazel ---- b/internal/lsp/cmd/test/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/cmd/test/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/cmd/test/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9532,7 +10484,7 @@ diff -urN b/internal/lsp/cmd/test/BUILD.bazel c/internal/lsp/cmd/test/BUILD.baze + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/command/BUILD.bazel c/internal/lsp/command/BUILD.bazel ---- b/internal/lsp/command/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/command/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/command/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9564,7 +10516,7 @@ diff -urN b/internal/lsp/command/BUILD.bazel c/internal/lsp/command/BUILD.bazel + ], +) diff -urN b/internal/lsp/command/commandmeta/BUILD.bazel c/internal/lsp/command/commandmeta/BUILD.bazel ---- b/internal/lsp/command/commandmeta/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/command/commandmeta/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/command/commandmeta/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9587,7 +10539,7 @@ diff -urN b/internal/lsp/command/commandmeta/BUILD.bazel c/internal/lsp/command/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/command/gen/BUILD.bazel c/internal/lsp/command/gen/BUILD.bazel ---- b/internal/lsp/command/gen/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/command/gen/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/command/gen/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9609,14 +10561,16 @@ diff -urN b/internal/lsp/command/gen/BUILD.bazel c/internal/lsp/command/gen/BUIL + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/debug/BUILD.bazel c/internal/lsp/debug/BUILD.bazel ---- b/internal/lsp/debug/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/debug/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/debug/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,36 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library") +@@ -0,0 +1,44 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "debug", + srcs = [ ++ "buildinfo_go1.12.go", ++ "buildinfo_go1.18.go", + "info.go", + "metrics.go", + "rpc.go", @@ -9634,12 +10588,12 @@ diff -urN b/internal/lsp/debug/BUILD.bazel c/internal/lsp/debug/BUILD.bazel + "//internal/event/export/prometheus", + "//internal/event/keys", + "//internal/event/label", ++ "//internal/lsp/bug", + "//internal/lsp/cache", + "//internal/lsp/debug/log", + "//internal/lsp/debug/tag", + "//internal/lsp/protocol", + "//internal/lsp/source", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -9648,8 +10602,14 @@ diff -urN b/internal/lsp/debug/BUILD.bazel c/internal/lsp/debug/BUILD.bazel + actual = ":debug", + visibility = ["//:__subpackages__"], +) ++ ++go_test( ++ name = "debug_test", ++ srcs = ["info_test.go"], ++ embed = [":debug"], ++) diff -urN b/internal/lsp/debug/log/BUILD.bazel c/internal/lsp/debug/log/BUILD.bazel ---- b/internal/lsp/debug/log/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/debug/log/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/debug/log/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9672,7 +10632,7 @@ diff -urN b/internal/lsp/debug/log/BUILD.bazel c/internal/lsp/debug/log/BUILD.ba + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/debug/tag/BUILD.bazel c/internal/lsp/debug/tag/BUILD.bazel ---- b/internal/lsp/debug/tag/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/debug/tag/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/debug/tag/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -9691,7 +10651,7 @@ diff -urN b/internal/lsp/debug/tag/BUILD.bazel c/internal/lsp/debug/tag/BUILD.ba + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/diff/BUILD.bazel c/internal/lsp/diff/BUILD.bazel ---- b/internal/lsp/diff/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/diff/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/diff/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9723,7 +10683,7 @@ diff -urN b/internal/lsp/diff/BUILD.bazel c/internal/lsp/diff/BUILD.bazel + ], +) diff -urN b/internal/lsp/diff/difftest/BUILD.bazel c/internal/lsp/diff/difftest/BUILD.bazel ---- b/internal/lsp/diff/difftest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/diff/difftest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/diff/difftest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9754,7 +10714,7 @@ diff -urN b/internal/lsp/diff/difftest/BUILD.bazel c/internal/lsp/diff/difftest/ + ], +) diff -urN b/internal/lsp/diff/myers/BUILD.bazel c/internal/lsp/diff/myers/BUILD.bazel ---- b/internal/lsp/diff/myers/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/diff/myers/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/diff/myers/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9785,7 +10745,7 @@ diff -urN b/internal/lsp/diff/myers/BUILD.bazel c/internal/lsp/diff/myers/BUILD. + ], +) diff -urN b/internal/lsp/fake/BUILD.bazel c/internal/lsp/fake/BUILD.bazel ---- b/internal/lsp/fake/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/fake/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/fake/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9800,6 +10760,7 @@ diff -urN b/internal/lsp/fake/BUILD.bazel c/internal/lsp/fake/BUILD.bazel + "proxy.go", + "sandbox.go", + "workdir.go", ++ "workdir_windows.go", + ], + importpath = "golang.org/x/tools/internal/lsp/fake", + visibility = ["//:__subpackages__"], @@ -9812,7 +10773,6 @@ diff -urN b/internal/lsp/fake/BUILD.bazel c/internal/lsp/fake/BUILD.bazel + "//internal/span", + "//internal/testenv", + "//txtar", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -9833,7 +10793,7 @@ diff -urN b/internal/lsp/fake/BUILD.bazel c/internal/lsp/fake/BUILD.bazel + deps = ["//internal/lsp/protocol"], +) diff -urN b/internal/lsp/fuzzy/BUILD.bazel c/internal/lsp/fuzzy/BUILD.bazel ---- b/internal/lsp/fuzzy/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/fuzzy/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/fuzzy/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -9865,7 +10825,7 @@ diff -urN b/internal/lsp/fuzzy/BUILD.bazel c/internal/lsp/fuzzy/BUILD.bazel + deps = [":fuzzy"], +) diff -urN b/internal/lsp/helper/BUILD.bazel c/internal/lsp/helper/BUILD.bazel ---- b/internal/lsp/helper/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/helper/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/helper/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -9883,16 +10843,23 @@ diff -urN b/internal/lsp/helper/BUILD.bazel c/internal/lsp/helper/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/lsppos/BUILD.bazel c/internal/lsp/lsppos/BUILD.bazel ---- b/internal/lsp/lsppos/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/lsppos/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/lsppos/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,14 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library") +@@ -0,0 +1,33 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lsppos", -+ srcs = ["lsppos.go"], ++ srcs = [ ++ "lsppos.go", ++ "token.go", ++ ], + importpath = "golang.org/x/tools/internal/lsp/lsppos", + visibility = ["//:__subpackages__"], ++ deps = [ ++ "//internal/lsp/protocol", ++ "//internal/lsp/safetoken", ++ ], +) + +alias( @@ -9900,10 +10867,22 @@ diff -urN b/internal/lsp/lsppos/BUILD.bazel c/internal/lsp/lsppos/BUILD.bazel + actual = ":lsppos", + visibility = ["//:__subpackages__"], +) ++ ++go_test( ++ name = "lsppos_test", ++ srcs = [ ++ "lsppos_test.go", ++ "token_test.go", ++ ], ++ deps = [ ++ ":lsppos", ++ "//internal/lsp/protocol", ++ ], ++) diff -urN b/internal/lsp/lsprpc/BUILD.bazel c/internal/lsp/lsprpc/BUILD.bazel ---- b/internal/lsp/lsprpc/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/lsprpc/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/lsprpc/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,61 @@ +@@ -0,0 +1,60 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9933,7 +10912,6 @@ diff -urN b/internal/lsp/lsprpc/BUILD.bazel c/internal/lsp/lsprpc/BUILD.bazel + "//internal/lsp/protocol", + "//internal/xcontext", + "@org_golang_x_sys//execabs:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -9966,9 +10944,9 @@ diff -urN b/internal/lsp/lsprpc/BUILD.bazel c/internal/lsp/lsprpc/BUILD.bazel + ], +) diff -urN b/internal/lsp/mod/BUILD.bazel c/internal/lsp/mod/BUILD.bazel ---- b/internal/lsp/mod/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/mod/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/mod/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,42 @@ +@@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -9987,9 +10965,7 @@ diff -urN b/internal/lsp/mod/BUILD.bazel c/internal/lsp/mod/BUILD.bazel + "//internal/lsp/debug/tag", + "//internal/lsp/protocol", + "//internal/lsp/source", -+ "//internal/span", + "@org_golang_x_mod//modfile:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -10012,7 +10988,7 @@ diff -urN b/internal/lsp/mod/BUILD.bazel c/internal/lsp/mod/BUILD.bazel + ], +) diff -urN b/internal/lsp/mod/testdata/unchanged/BUILD.bazel c/internal/lsp/mod/testdata/unchanged/BUILD.bazel ---- b/internal/lsp/mod/testdata/unchanged/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/mod/testdata/unchanged/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/mod/testdata/unchanged/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10030,9 +11006,9 @@ diff -urN b/internal/lsp/mod/testdata/unchanged/BUILD.bazel c/internal/lsp/mod/t + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/progress/BUILD.bazel c/internal/lsp/progress/BUILD.bazel ---- b/internal/lsp/progress/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/progress/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/progress/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -10045,7 +11021,6 @@ diff -urN b/internal/lsp/progress/BUILD.bazel c/internal/lsp/progress/BUILD.baze + "//internal/lsp/debug/tag", + "//internal/lsp/protocol", + "//internal/xcontext", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -10062,9 +11037,9 @@ diff -urN b/internal/lsp/progress/BUILD.bazel c/internal/lsp/progress/BUILD.baze + deps = ["//internal/lsp/protocol"], +) diff -urN b/internal/lsp/protocol/BUILD.bazel c/internal/lsp/protocol/BUILD.bazel ---- b/internal/lsp/protocol/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/protocol/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/protocol/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,36 @@ +@@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -10092,7 +11067,6 @@ diff -urN b/internal/lsp/protocol/BUILD.bazel c/internal/lsp/protocol/BUILD.baze + "//internal/jsonrpc2_v2", + "//internal/span", + "//internal/xcontext", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -10102,7 +11076,7 @@ diff -urN b/internal/lsp/protocol/BUILD.bazel c/internal/lsp/protocol/BUILD.baze + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/regtest/BUILD.bazel c/internal/lsp/regtest/BUILD.bazel ---- b/internal/lsp/regtest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/regtest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/regtest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -10150,8 +11124,32 @@ diff -urN b/internal/lsp/regtest/BUILD.bazel c/internal/lsp/regtest/BUILD.bazel + embed = [":regtest"], + deps = ["//internal/lsp/protocol"], +) +diff -urN b/internal/lsp/safetoken/BUILD.bazel c/internal/lsp/safetoken/BUILD.bazel +--- b/internal/lsp/safetoken/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/safetoken/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,20 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "safetoken", ++ srcs = ["safetoken.go"], ++ importpath = "golang.org/x/tools/internal/lsp/safetoken", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":safetoken", ++ visibility = ["//:__subpackages__"], ++) ++ ++go_test( ++ name = "safetoken_test", ++ srcs = ["safetoken_test.go"], ++ deps = ["//go/packages"], ++) diff -urN b/internal/lsp/snippet/BUILD.bazel c/internal/lsp/snippet/BUILD.bazel ---- b/internal/lsp/snippet/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/snippet/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/snippet/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -10175,9 +11173,9 @@ diff -urN b/internal/lsp/snippet/BUILD.bazel c/internal/lsp/snippet/BUILD.bazel + embed = [":snippet"], +) diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel ---- b/internal/lsp/source/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/source/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/source/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,135 @@ +@@ -0,0 +1,139 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -10204,6 +11202,7 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "rename.go", + "rename_check.go", + "signature_help.go", ++ "stub.go", + "symbols.go", + "types_format.go", + "util.go", @@ -10247,11 +11246,13 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "//go/analysis/passes/unusedresult", + "//go/analysis/passes/unusedwrite", + "//go/ast/astutil", ++ "//go/packages", + "//go/types/typeutil", + "//internal/analysisinternal", + "//internal/event", + "//internal/gocommand", + "//internal/imports", ++ "//internal/lsp/analysis/embeddirective", + "//internal/lsp/analysis/fillreturns", + "//internal/lsp/analysis/fillstruct", + "//internal/lsp/analysis/infertypeargs", @@ -10260,9 +11261,11 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "//internal/lsp/analysis/simplifycompositelit", + "//internal/lsp/analysis/simplifyrange", + "//internal/lsp/analysis/simplifyslice", ++ "//internal/lsp/analysis/stubmethods", + "//internal/lsp/analysis/undeclaredname", + "//internal/lsp/analysis/unusedparams", + "//internal/lsp/analysis/useany", ++ "//internal/lsp/bug", + "//internal/lsp/command", + "//internal/lsp/debug/tag", + "//internal/lsp/diff", @@ -10271,13 +11274,13 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "//internal/lsp/lsppos", + "//internal/lsp/progress", + "//internal/lsp/protocol", ++ "//internal/lsp/safetoken", + "//internal/span", + "//internal/typeparams", + "//refactor/satisfy", + "@org_golang_x_mod//modfile:go_default_library", + "@org_golang_x_mod//module:go_default_library", + "@org_golang_x_text//unicode/runenames:go_default_library", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) + @@ -10293,14 +11296,14 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "comment_test.go", + "format_test.go", + "identifier_test.go", -+ "offset_test.go", + "options_test.go", + "source_test.go", ++ "util_test.go", + "workspace_symbol_test.go", + ], + embed = [":source"], + deps = [ -+ "//go/packages", ++ "//internal/lsp/bug", + "//internal/lsp/cache", + "//internal/lsp/diff", + "//internal/lsp/diff/myers", @@ -10310,13 +11313,12 @@ diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel + "//internal/lsp/tests", + "//internal/span", + "//internal/testenv", -+ "@org_golang_x_xerrors//:go_default_library", + ], +) diff -urN b/internal/lsp/source/completion/BUILD.bazel c/internal/lsp/source/completion/BUILD.bazel ---- b/internal/lsp/source/completion/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/source/completion/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/source/completion/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,53 @@ +@@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -10325,7 +11327,9 @@ diff -urN b/internal/lsp/source/completion/BUILD.bazel c/internal/lsp/source/com + "builtin.go", + "completion.go", + "deep_completion.go", ++ "definition.go", + "format.go", ++ "fuzz.go", + "keywords.go", + "labels.go", + "literal.go", @@ -10340,17 +11344,19 @@ diff -urN b/internal/lsp/source/completion/BUILD.bazel c/internal/lsp/source/com + visibility = ["//:__subpackages__"], + deps = [ + "//go/ast/astutil", ++ "//go/types/typeutil", + "//internal/event", + "//internal/imports", -+ "//internal/lsp/debug", ++ "//internal/lsp/bug", + "//internal/lsp/debug/tag", + "//internal/lsp/diff", + "//internal/lsp/fuzzy", + "//internal/lsp/protocol", ++ "//internal/lsp/safetoken", + "//internal/lsp/snippet", + "//internal/lsp/source", + "//internal/span", -+ "@org_golang_x_xerrors//:go_default_library", ++ "//internal/typeparams", + ], +) + @@ -10371,7 +11377,7 @@ diff -urN b/internal/lsp/source/completion/BUILD.bazel c/internal/lsp/source/com + embed = [":completion"], +) diff -urN b/internal/lsp/template/BUILD.bazel c/internal/lsp/template/BUILD.bazel ---- b/internal/lsp/template/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/template/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/template/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -10411,7 +11417,7 @@ diff -urN b/internal/lsp/template/BUILD.bazel c/internal/lsp/template/BUILD.baze + deps = ["//internal/lsp/protocol"], +) diff -urN b/internal/lsp/testdata/%percent/BUILD.bazel c/internal/lsp/testdata/%percent/BUILD.bazel ---- b/internal/lsp/testdata/%percent/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/%percent/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/%percent/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10429,7 +11435,7 @@ diff -urN b/internal/lsp/testdata/%percent/BUILD.bazel c/internal/lsp/testdata/% + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/address/BUILD.bazel c/internal/lsp/testdata/address/BUILD.bazel ---- b/internal/lsp/testdata/address/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/address/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/address/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10447,7 +11453,7 @@ diff -urN b/internal/lsp/testdata/address/BUILD.bazel c/internal/lsp/testdata/ad + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/analyzer/BUILD.bazel c/internal/lsp/testdata/analyzer/BUILD.bazel ---- b/internal/lsp/testdata/analyzer/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/analyzer/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/analyzer/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,6 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") @@ -10457,7 +11463,7 @@ diff -urN b/internal/lsp/testdata/analyzer/BUILD.bazel c/internal/lsp/testdata/a + srcs = ["bad_test.go"], +) diff -urN b/internal/lsp/testdata/append/BUILD.bazel c/internal/lsp/testdata/append/BUILD.bazel ---- b/internal/lsp/testdata/append/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/append/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/append/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10475,7 +11481,7 @@ diff -urN b/internal/lsp/testdata/append/BUILD.bazel c/internal/lsp/testdata/app + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/assign/internal/secret/BUILD.bazel c/internal/lsp/testdata/assign/internal/secret/BUILD.bazel ---- b/internal/lsp/testdata/assign/internal/secret/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/assign/internal/secret/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/assign/internal/secret/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10493,7 +11499,7 @@ diff -urN b/internal/lsp/testdata/assign/internal/secret/BUILD.bazel c/internal/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/bad/BUILD.bazel c/internal/lsp/testdata/bad/BUILD.bazel ---- b/internal/lsp/testdata/bad/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/bad/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/bad/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10514,7 +11520,7 @@ diff -urN b/internal/lsp/testdata/bad/BUILD.bazel c/internal/lsp/testdata/bad/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/basiclit/BUILD.bazel c/internal/lsp/testdata/basiclit/BUILD.bazel ---- b/internal/lsp/testdata/basiclit/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/basiclit/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/basiclit/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10532,7 +11538,7 @@ diff -urN b/internal/lsp/testdata/basiclit/BUILD.bazel c/internal/lsp/testdata/b + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/builtins/BUILD.bazel c/internal/lsp/testdata/builtins/BUILD.bazel ---- b/internal/lsp/testdata/builtins/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/builtins/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/builtins/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10555,7 +11561,7 @@ diff -urN b/internal/lsp/testdata/builtins/BUILD.bazel c/internal/lsp/testdata/b + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/callhierarchy/BUILD.bazel c/internal/lsp/testdata/callhierarchy/BUILD.bazel ---- b/internal/lsp/testdata/callhierarchy/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/callhierarchy/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/callhierarchy/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10573,7 +11579,7 @@ diff -urN b/internal/lsp/testdata/callhierarchy/BUILD.bazel c/internal/lsp/testd + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel c/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel ---- b/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10591,7 +11597,7 @@ diff -urN b/internal/lsp/testdata/callhierarchy/incoming/BUILD.bazel c/internal/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel c/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel ---- b/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10609,7 +11615,7 @@ diff -urN b/internal/lsp/testdata/callhierarchy/outgoing/BUILD.bazel c/internal/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/casesensitive/BUILD.bazel c/internal/lsp/testdata/casesensitive/BUILD.bazel ---- b/internal/lsp/testdata/casesensitive/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/casesensitive/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/casesensitive/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10627,7 +11633,7 @@ diff -urN b/internal/lsp/testdata/casesensitive/BUILD.bazel c/internal/lsp/testd + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/cgo/BUILD.bazel c/internal/lsp/testdata/cgo/BUILD.bazel ---- b/internal/lsp/testdata/cgo/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/cgo/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/cgo/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10649,7 +11655,7 @@ diff -urN b/internal/lsp/testdata/cgo/BUILD.bazel c/internal/lsp/testdata/cgo/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/channel/BUILD.bazel c/internal/lsp/testdata/channel/BUILD.bazel ---- b/internal/lsp/testdata/channel/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/channel/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/channel/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10667,7 +11673,7 @@ diff -urN b/internal/lsp/testdata/channel/BUILD.bazel c/internal/lsp/testdata/ch + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/codelens/BUILD.bazel c/internal/lsp/testdata/codelens/BUILD.bazel ---- b/internal/lsp/testdata/codelens/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/codelens/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/codelens/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,6 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") @@ -10677,7 +11683,7 @@ diff -urN b/internal/lsp/testdata/codelens/BUILD.bazel c/internal/lsp/testdata/c + srcs = ["codelens_test.go"], +) diff -urN b/internal/lsp/testdata/constant/BUILD.bazel c/internal/lsp/testdata/constant/BUILD.bazel ---- b/internal/lsp/testdata/constant/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/constant/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/constant/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10695,7 +11701,7 @@ diff -urN b/internal/lsp/testdata/constant/BUILD.bazel c/internal/lsp/testdata/c + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/danglingstmt/BUILD.bazel c/internal/lsp/testdata/danglingstmt/BUILD.bazel ---- b/internal/lsp/testdata/danglingstmt/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/danglingstmt/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/danglingstmt/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10727,7 +11733,7 @@ diff -urN b/internal/lsp/testdata/danglingstmt/BUILD.bazel c/internal/lsp/testda + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/deep/BUILD.bazel c/internal/lsp/testdata/deep/BUILD.bazel ---- b/internal/lsp/testdata/deep/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/deep/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/deep/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10745,7 +11751,7 @@ diff -urN b/internal/lsp/testdata/deep/BUILD.bazel c/internal/lsp/testdata/deep/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/errors/BUILD.bazel c/internal/lsp/testdata/errors/BUILD.bazel ---- b/internal/lsp/testdata/errors/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/errors/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/errors/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10763,7 +11769,7 @@ diff -urN b/internal/lsp/testdata/errors/BUILD.bazel c/internal/lsp/testdata/err + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/extract/extract_function/BUILD.bazel c/internal/lsp/testdata/extract/extract_function/BUILD.bazel ---- b/internal/lsp/testdata/extract/extract_function/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/extract/extract_function/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/extract/extract_function/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10799,7 +11805,7 @@ diff -urN b/internal/lsp/testdata/extract/extract_function/BUILD.bazel c/interna + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/extract/extract_method/BUILD.bazel c/internal/lsp/testdata/extract/extract_method/BUILD.bazel ---- b/internal/lsp/testdata/extract/extract_method/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/extract/extract_method/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/extract/extract_method/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10817,7 +11823,7 @@ diff -urN b/internal/lsp/testdata/extract/extract_method/BUILD.bazel c/internal/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/extract/extract_variable/BUILD.bazel c/internal/lsp/testdata/extract/extract_variable/BUILD.bazel ---- b/internal/lsp/testdata/extract/extract_variable/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/extract/extract_variable/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/extract/extract_variable/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10839,7 +11845,7 @@ diff -urN b/internal/lsp/testdata/extract/extract_variable/BUILD.bazel c/interna + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/fieldlist/BUILD.bazel c/internal/lsp/testdata/fieldlist/BUILD.bazel ---- b/internal/lsp/testdata/fieldlist/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/fieldlist/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/fieldlist/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10857,9 +11863,9 @@ diff -urN b/internal/lsp/testdata/fieldlist/BUILD.bazel c/internal/lsp/testdata/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/fillstruct/BUILD.bazel c/internal/lsp/testdata/fillstruct/BUILD.bazel ---- b/internal/lsp/testdata/fillstruct/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/fillstruct/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/fillstruct/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -10875,6 +11881,7 @@ diff -urN b/internal/lsp/testdata/fillstruct/BUILD.bazel c/internal/lsp/testdata + "fill_struct_package.go", + "fill_struct_partial.go", + "fill_struct_spaces.go", ++ "fill_struct_unsafe.go", + ], + importpath = "golang.org/x/tools/internal/lsp/testdata/fillstruct", + visibility = ["//:__subpackages__"], @@ -10886,7 +11893,7 @@ diff -urN b/internal/lsp/testdata/fillstruct/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/fillstruct/data/BUILD.bazel c/internal/lsp/testdata/fillstruct/data/BUILD.bazel ---- b/internal/lsp/testdata/fillstruct/data/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/fillstruct/data/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/fillstruct/data/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10904,7 +11911,7 @@ diff -urN b/internal/lsp/testdata/fillstruct/data/BUILD.bazel c/internal/lsp/tes + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/folding/BUILD.bazel c/internal/lsp/testdata/folding/BUILD.bazel ---- b/internal/lsp/testdata/folding/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/folding/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/folding/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10922,7 +11929,7 @@ diff -urN b/internal/lsp/testdata/folding/BUILD.bazel c/internal/lsp/testdata/fo + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/foo/BUILD.bazel c/internal/lsp/testdata/foo/BUILD.bazel ---- b/internal/lsp/testdata/foo/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/foo/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/foo/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10940,7 +11947,7 @@ diff -urN b/internal/lsp/testdata/foo/BUILD.bazel c/internal/lsp/testdata/foo/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/format/BUILD.bazel c/internal/lsp/testdata/format/BUILD.bazel ---- b/internal/lsp/testdata/format/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/format/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/format/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10958,7 +11965,7 @@ diff -urN b/internal/lsp/testdata/format/BUILD.bazel c/internal/lsp/testdata/for + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/funcsig/BUILD.bazel c/internal/lsp/testdata/funcsig/BUILD.bazel ---- b/internal/lsp/testdata/funcsig/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/funcsig/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/funcsig/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10976,7 +11983,7 @@ diff -urN b/internal/lsp/testdata/funcsig/BUILD.bazel c/internal/lsp/testdata/fu + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/funcvalue/BUILD.bazel c/internal/lsp/testdata/funcvalue/BUILD.bazel ---- b/internal/lsp/testdata/funcvalue/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/funcvalue/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/funcvalue/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -10994,7 +12001,7 @@ diff -urN b/internal/lsp/testdata/funcvalue/BUILD.bazel c/internal/lsp/testdata/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/fuzzymatch/BUILD.bazel c/internal/lsp/testdata/fuzzymatch/BUILD.bazel ---- b/internal/lsp/testdata/fuzzymatch/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/fuzzymatch/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/fuzzymatch/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11012,7 +12019,7 @@ diff -urN b/internal/lsp/testdata/fuzzymatch/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/generate/BUILD.bazel c/internal/lsp/testdata/generate/BUILD.bazel ---- b/internal/lsp/testdata/generate/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/generate/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/generate/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11030,7 +12037,7 @@ diff -urN b/internal/lsp/testdata/generate/BUILD.bazel c/internal/lsp/testdata/g + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/generated/BUILD.bazel c/internal/lsp/testdata/generated/BUILD.bazel ---- b/internal/lsp/testdata/generated/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/generated/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/generated/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11051,7 +12058,7 @@ diff -urN b/internal/lsp/testdata/generated/BUILD.bazel c/internal/lsp/testdata/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/godef/a/BUILD.bazel c/internal/lsp/testdata/godef/a/BUILD.bazel ---- b/internal/lsp/testdata/godef/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/godef/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/godef/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11085,7 +12092,7 @@ diff -urN b/internal/lsp/testdata/godef/a/BUILD.bazel c/internal/lsp/testdata/go + embed = [":a"], +) diff -urN b/internal/lsp/testdata/godef/b/BUILD.bazel c/internal/lsp/testdata/godef/b/BUILD.bazel ---- b/internal/lsp/testdata/godef/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/godef/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/godef/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11107,8 +12114,26 @@ diff -urN b/internal/lsp/testdata/godef/b/BUILD.bazel c/internal/lsp/testdata/go + actual = ":b", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/testdata/godef/hover_generics/BUILD.bazel c/internal/lsp/testdata/godef/hover_generics/BUILD.bazel +--- b/internal/lsp/testdata/godef/hover_generics/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/testdata/godef/hover_generics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "hover_generics", ++ srcs = ["hover.go"], ++ importpath = "golang.org/x/tools/internal/lsp/testdata/godef/hover_generics", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":hover_generics", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/testdata/godef/infer_generics/BUILD.bazel c/internal/lsp/testdata/godef/infer_generics/BUILD.bazel ---- b/internal/lsp/testdata/godef/infer_generics/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/godef/infer_generics/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/godef/infer_generics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11126,7 +12151,7 @@ diff -urN b/internal/lsp/testdata/godef/infer_generics/BUILD.bazel c/internal/ls + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/good/BUILD.bazel c/internal/lsp/testdata/good/BUILD.bazel ---- b/internal/lsp/testdata/good/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/good/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/good/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11147,7 +12172,7 @@ diff -urN b/internal/lsp/testdata/good/BUILD.bazel c/internal/lsp/testdata/good/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/highlights/BUILD.bazel c/internal/lsp/testdata/highlights/BUILD.bazel ---- b/internal/lsp/testdata/highlights/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/highlights/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/highlights/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11165,7 +12190,7 @@ diff -urN b/internal/lsp/testdata/highlights/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/implementation/BUILD.bazel c/internal/lsp/testdata/implementation/BUILD.bazel ---- b/internal/lsp/testdata/implementation/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/implementation/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/implementation/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11183,7 +12208,7 @@ diff -urN b/internal/lsp/testdata/implementation/BUILD.bazel c/internal/lsp/test + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/implementation/other/BUILD.bazel c/internal/lsp/testdata/implementation/other/BUILD.bazel ---- b/internal/lsp/testdata/implementation/other/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/implementation/other/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/implementation/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11207,7 +12232,7 @@ diff -urN b/internal/lsp/testdata/implementation/other/BUILD.bazel c/internal/ls + embed = [":other"], +) diff -urN b/internal/lsp/testdata/index/BUILD.bazel c/internal/lsp/testdata/index/BUILD.bazel ---- b/internal/lsp/testdata/index/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/index/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/index/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11225,7 +12250,7 @@ diff -urN b/internal/lsp/testdata/index/BUILD.bazel c/internal/lsp/testdata/inde + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/interfacerank/BUILD.bazel c/internal/lsp/testdata/interfacerank/BUILD.bazel ---- b/internal/lsp/testdata/interfacerank/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/interfacerank/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/interfacerank/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11243,7 +12268,7 @@ diff -urN b/internal/lsp/testdata/interfacerank/BUILD.bazel c/internal/lsp/testd + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/keywords/BUILD.bazel c/internal/lsp/testdata/keywords/BUILD.bazel ---- b/internal/lsp/testdata/keywords/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/keywords/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/keywords/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11265,7 +12290,7 @@ diff -urN b/internal/lsp/testdata/keywords/BUILD.bazel c/internal/lsp/testdata/k + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/labels/BUILD.bazel c/internal/lsp/testdata/labels/BUILD.bazel ---- b/internal/lsp/testdata/labels/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/labels/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/labels/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11283,7 +12308,7 @@ diff -urN b/internal/lsp/testdata/labels/BUILD.bazel c/internal/lsp/testdata/lab + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/links/BUILD.bazel c/internal/lsp/testdata/links/BUILD.bazel ---- b/internal/lsp/testdata/links/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/links/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/links/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11301,7 +12326,7 @@ diff -urN b/internal/lsp/testdata/links/BUILD.bazel c/internal/lsp/testdata/link + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/missingfunction/BUILD.bazel c/internal/lsp/testdata/missingfunction/BUILD.bazel ---- b/internal/lsp/testdata/missingfunction/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/missingfunction/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/missingfunction/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11329,7 +12354,7 @@ diff -urN b/internal/lsp/testdata/missingfunction/BUILD.bazel c/internal/lsp/tes + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/nodisk/BUILD.bazel c/internal/lsp/testdata/nodisk/BUILD.bazel ---- b/internal/lsp/testdata/nodisk/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/nodisk/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/nodisk/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11347,7 +12372,7 @@ diff -urN b/internal/lsp/testdata/nodisk/BUILD.bazel c/internal/lsp/testdata/nod + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/printf/BUILD.bazel c/internal/lsp/testdata/printf/BUILD.bazel ---- b/internal/lsp/testdata/printf/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/printf/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/printf/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11365,7 +12390,7 @@ diff -urN b/internal/lsp/testdata/printf/BUILD.bazel c/internal/lsp/testdata/pri + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rank/BUILD.bazel c/internal/lsp/testdata/rank/BUILD.bazel ---- b/internal/lsp/testdata/rank/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rank/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rank/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11383,7 +12408,7 @@ diff -urN b/internal/lsp/testdata/rank/BUILD.bazel c/internal/lsp/testdata/rank/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rank/struct/BUILD.bazel c/internal/lsp/testdata/rank/struct/BUILD.bazel ---- b/internal/lsp/testdata/rank/struct/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rank/struct/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rank/struct/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11401,7 +12426,7 @@ diff -urN b/internal/lsp/testdata/rank/struct/BUILD.bazel c/internal/lsp/testdat + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/references/BUILD.bazel c/internal/lsp/testdata/references/BUILD.bazel ---- b/internal/lsp/testdata/references/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/references/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/references/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,6 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") @@ -11411,7 +12436,7 @@ diff -urN b/internal/lsp/testdata/references/BUILD.bazel c/internal/lsp/testdata + srcs = ["refs_test.go"], +) diff -urN b/internal/lsp/testdata/references/another/BUILD.bazel c/internal/lsp/testdata/references/another/BUILD.bazel ---- b/internal/lsp/testdata/references/another/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/references/another/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/references/another/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11429,7 +12454,7 @@ diff -urN b/internal/lsp/testdata/references/another/BUILD.bazel c/internal/lsp/ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/references/interfaces/BUILD.bazel c/internal/lsp/testdata/references/interfaces/BUILD.bazel ---- b/internal/lsp/testdata/references/interfaces/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/references/interfaces/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/references/interfaces/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11447,7 +12472,7 @@ diff -urN b/internal/lsp/testdata/references/interfaces/BUILD.bazel c/internal/l + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/references/other/BUILD.bazel c/internal/lsp/testdata/references/other/BUILD.bazel ---- b/internal/lsp/testdata/references/other/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/references/other/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/references/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11465,7 +12490,7 @@ diff -urN b/internal/lsp/testdata/references/other/BUILD.bazel c/internal/lsp/te + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/b/BUILD.bazel c/internal/lsp/testdata/rename/b/BUILD.bazel ---- b/internal/lsp/testdata/rename/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11483,7 +12508,7 @@ diff -urN b/internal/lsp/testdata/rename/b/BUILD.bazel c/internal/lsp/testdata/r + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/c/BUILD.bazel c/internal/lsp/testdata/rename/c/BUILD.bazel ---- b/internal/lsp/testdata/rename/c/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/c/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/c/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11504,7 +12529,7 @@ diff -urN b/internal/lsp/testdata/rename/c/BUILD.bazel c/internal/lsp/testdata/r + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/crosspkg/BUILD.bazel c/internal/lsp/testdata/rename/crosspkg/BUILD.bazel ---- b/internal/lsp/testdata/rename/crosspkg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/crosspkg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/crosspkg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11522,7 +12547,7 @@ diff -urN b/internal/lsp/testdata/rename/crosspkg/BUILD.bazel c/internal/lsp/tes + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel c/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel ---- b/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11540,7 +12565,7 @@ diff -urN b/internal/lsp/testdata/rename/crosspkg/another/BUILD.bazel c/internal + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel c/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel ---- b/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11557,8 +12582,30 @@ diff -urN b/internal/lsp/testdata/rename/crosspkg/other/BUILD.bazel c/internal/l + actual = ":other", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/testdata/rename/generics/BUILD.bazel c/internal/lsp/testdata/rename/generics/BUILD.bazel +--- b/internal/lsp/testdata/rename/generics/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/testdata/rename/generics/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,18 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "generics", ++ srcs = [ ++ "embedded.go", ++ "generics.go", ++ "unions.go", ++ ], ++ importpath = "golang.org/x/tools/internal/lsp/testdata/rename/generics", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":generics", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/testdata/rename/issue42134/BUILD.bazel c/internal/lsp/testdata/rename/issue42134/BUILD.bazel ---- b/internal/lsp/testdata/rename/issue42134/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/issue42134/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/issue42134/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11581,7 +12628,7 @@ diff -urN b/internal/lsp/testdata/rename/issue42134/BUILD.bazel c/internal/lsp/t + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/shadow/BUILD.bazel c/internal/lsp/testdata/rename/shadow/BUILD.bazel ---- b/internal/lsp/testdata/rename/shadow/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/shadow/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/shadow/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11599,7 +12646,7 @@ diff -urN b/internal/lsp/testdata/rename/shadow/BUILD.bazel c/internal/lsp/testd + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/rename/testy/BUILD.bazel c/internal/lsp/testdata/rename/testy/BUILD.bazel ---- b/internal/lsp/testdata/rename/testy/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/rename/testy/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/rename/testy/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11623,7 +12670,7 @@ diff -urN b/internal/lsp/testdata/rename/testy/BUILD.bazel c/internal/lsp/testda + embed = [":testy"], +) diff -urN b/internal/lsp/testdata/semantic/BUILD.bazel c/internal/lsp/testdata/semantic/BUILD.bazel ---- b/internal/lsp/testdata/semantic/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/semantic/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/semantic/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11650,7 +12697,7 @@ diff -urN b/internal/lsp/testdata/semantic/BUILD.bazel c/internal/lsp/testdata/s + embed = [":semantic"], +) diff -urN b/internal/lsp/testdata/signature/BUILD.bazel c/internal/lsp/testdata/signature/BUILD.bazel ---- b/internal/lsp/testdata/signature/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/signature/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/signature/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11673,7 +12720,7 @@ diff -urN b/internal/lsp/testdata/signature/BUILD.bazel c/internal/lsp/testdata/ + srcs = ["signature_test.go"], +) diff -urN b/internal/lsp/testdata/snippets/BUILD.bazel c/internal/lsp/testdata/snippets/BUILD.bazel ---- b/internal/lsp/testdata/snippets/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/snippets/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/snippets/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11694,7 +12741,7 @@ diff -urN b/internal/lsp/testdata/snippets/BUILD.bazel c/internal/lsp/testdata/s + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/statements/BUILD.bazel c/internal/lsp/testdata/statements/BUILD.bazel ---- b/internal/lsp/testdata/statements/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/statements/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/statements/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11721,8 +12768,59 @@ diff -urN b/internal/lsp/testdata/statements/BUILD.bazel c/internal/lsp/testdata + srcs = ["if_err_check_test.go"], + embed = [":statements"], +) +diff -urN b/internal/lsp/testdata/stub/BUILD.bazel c/internal/lsp/testdata/stub/BUILD.bazel +--- b/internal/lsp/testdata/stub/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/testdata/stub/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,29 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "stub", ++ srcs = [ ++ "stub_add_selector.go", ++ "stub_assign.go", ++ "stub_assign_multivars.go", ++ "stub_call_expr.go", ++ "stub_embedded.go", ++ "stub_err.go", ++ "stub_function_return.go", ++ "stub_generic_receiver.go", ++ "stub_ignored_imports.go", ++ "stub_multi_var.go", ++ "stub_pointer.go", ++ "stub_renamed_import.go", ++ "stub_renamed_import_iface.go", ++ "stub_stdlib.go", ++ ], ++ importpath = "golang.org/x/tools/internal/lsp/testdata/stub", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":stub", ++ visibility = ["//:__subpackages__"], ++) +diff -urN b/internal/lsp/testdata/stub/other/BUILD.bazel c/internal/lsp/testdata/stub/other/BUILD.bazel +--- b/internal/lsp/testdata/stub/other/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/testdata/stub/other/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "other", ++ srcs = ["other.go"], ++ importpath = "golang.org/x/tools/internal/lsp/testdata/stub/other", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":other", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/testdata/suggestedfix/BUILD.bazel c/internal/lsp/testdata/suggestedfix/BUILD.bazel ---- b/internal/lsp/testdata/suggestedfix/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/suggestedfix/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/suggestedfix/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11740,7 +12838,7 @@ diff -urN b/internal/lsp/testdata/suggestedfix/BUILD.bazel c/internal/lsp/testda + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/symbols/BUILD.bazel c/internal/lsp/testdata/symbols/BUILD.bazel ---- b/internal/lsp/testdata/symbols/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/symbols/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/symbols/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -11758,7 +12856,7 @@ diff -urN b/internal/lsp/testdata/symbols/BUILD.bazel c/internal/lsp/testdata/sy + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/testy/BUILD.bazel c/internal/lsp/testdata/testy/BUILD.bazel ---- b/internal/lsp/testdata/testy/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/testy/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/testy/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11782,7 +12880,7 @@ diff -urN b/internal/lsp/testdata/testy/BUILD.bazel c/internal/lsp/testdata/test + embed = [":testy"], +) diff -urN b/internal/lsp/testdata/typdef/BUILD.bazel c/internal/lsp/testdata/typdef/BUILD.bazel ---- b/internal/lsp/testdata/typdef/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/typdef/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/typdef/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11800,7 +12898,7 @@ diff -urN b/internal/lsp/testdata/typdef/BUILD.bazel c/internal/lsp/testdata/typ + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/typeassert/BUILD.bazel c/internal/lsp/testdata/typeassert/BUILD.bazel ---- b/internal/lsp/testdata/typeassert/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/typeassert/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/typeassert/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11818,7 +12916,7 @@ diff -urN b/internal/lsp/testdata/typeassert/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/typeerrors/BUILD.bazel c/internal/lsp/testdata/typeerrors/BUILD.bazel ---- b/internal/lsp/testdata/typeerrors/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/typeerrors/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/typeerrors/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11836,7 +12934,7 @@ diff -urN b/internal/lsp/testdata/typeerrors/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/typemods/BUILD.bazel c/internal/lsp/testdata/typemods/BUILD.bazel ---- b/internal/lsp/testdata/typemods/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/typemods/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/typemods/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11853,8 +12951,26 @@ diff -urN b/internal/lsp/testdata/typemods/BUILD.bazel c/internal/lsp/testdata/t + actual = ":typemods", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/testdata/typeparams/BUILD.bazel c/internal/lsp/testdata/typeparams/BUILD.bazel +--- b/internal/lsp/testdata/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/testdata/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "typeparams", ++ srcs = ["type_params.go"], ++ importpath = "golang.org/x/tools/internal/lsp/testdata/typeparams", ++ visibility = ["//:__subpackages__"], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":typeparams", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/lsp/testdata/types/BUILD.bazel c/internal/lsp/testdata/types/BUILD.bazel ---- b/internal/lsp/testdata/types/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/types/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/types/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11872,7 +12988,7 @@ diff -urN b/internal/lsp/testdata/types/BUILD.bazel c/internal/lsp/testdata/type + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/undeclared/BUILD.bazel c/internal/lsp/testdata/undeclared/BUILD.bazel ---- b/internal/lsp/testdata/undeclared/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/undeclared/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/undeclared/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11890,7 +13006,7 @@ diff -urN b/internal/lsp/testdata/undeclared/BUILD.bazel c/internal/lsp/testdata + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/unimported/BUILD.bazel c/internal/lsp/testdata/unimported/BUILD.bazel ---- b/internal/lsp/testdata/unimported/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/unimported/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/unimported/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -11917,7 +13033,7 @@ diff -urN b/internal/lsp/testdata/unimported/BUILD.bazel c/internal/lsp/testdata + embed = [":unimported"], +) diff -urN b/internal/lsp/testdata/unsafe/BUILD.bazel c/internal/lsp/testdata/unsafe/BUILD.bazel ---- b/internal/lsp/testdata/unsafe/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/unsafe/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/unsafe/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11935,7 +13051,7 @@ diff -urN b/internal/lsp/testdata/unsafe/BUILD.bazel c/internal/lsp/testdata/uns + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/variadic/BUILD.bazel c/internal/lsp/testdata/variadic/BUILD.bazel ---- b/internal/lsp/testdata/variadic/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/variadic/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/variadic/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -11953,7 +13069,7 @@ diff -urN b/internal/lsp/testdata/variadic/BUILD.bazel c/internal/lsp/testdata/v + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/workspacesymbol/BUILD.bazel c/internal/lsp/testdata/workspacesymbol/BUILD.bazel ---- b/internal/lsp/testdata/workspacesymbol/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/workspacesymbol/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/workspacesymbol/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -11975,7 +13091,7 @@ diff -urN b/internal/lsp/testdata/workspacesymbol/BUILD.bazel c/internal/lsp/tes + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel c/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel ---- b/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12002,7 +13118,7 @@ diff -urN b/internal/lsp/testdata/workspacesymbol/a/BUILD.bazel c/internal/lsp/t + embed = [":a"], +) diff -urN b/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel c/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel ---- b/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12020,7 +13136,7 @@ diff -urN b/internal/lsp/testdata/workspacesymbol/b/BUILD.bazel c/internal/lsp/t + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel c/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel ---- b/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12038,7 +13154,7 @@ diff -urN b/internal/lsp/testdata/workspacesymbol/p/BUILD.bazel c/internal/lsp/t + visibility = ["//:__subpackages__"], +) diff -urN b/internal/lsp/tests/BUILD.bazel c/internal/lsp/tests/BUILD.bazel ---- b/internal/lsp/tests/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/lsp/tests/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/lsp/tests/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12074,8 +13190,39 @@ diff -urN b/internal/lsp/tests/BUILD.bazel c/internal/lsp/tests/BUILD.bazel + actual = ":tests", + visibility = ["//:__subpackages__"], +) +diff -urN b/internal/lsp/work/BUILD.bazel c/internal/lsp/work/BUILD.bazel +--- b/internal/lsp/work/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 ++++ c/internal/lsp/work/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -0,0 +1,27 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library") ++ ++go_library( ++ name = "work", ++ srcs = [ ++ "completion.go", ++ "diagnostics.go", ++ "format.go", ++ "hover.go", ++ ], ++ importpath = "golang.org/x/tools/internal/lsp/work", ++ visibility = ["//:__subpackages__"], ++ deps = [ ++ "//internal/event", ++ "//internal/lsp/debug/tag", ++ "//internal/lsp/protocol", ++ "//internal/lsp/source", ++ "//internal/span", ++ "@org_golang_x_mod//modfile:go_default_library", ++ ], ++) ++ ++alias( ++ name = "go_default_library", ++ actual = ":work", ++ visibility = ["//:__subpackages__"], ++) diff -urN b/internal/memoize/BUILD.bazel c/internal/memoize/BUILD.bazel ---- b/internal/memoize/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/memoize/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/memoize/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12099,52 +13246,8 @@ diff -urN b/internal/memoize/BUILD.bazel c/internal/memoize/BUILD.bazel + srcs = ["memoize_test.go"], + deps = [":memoize"], +) -diff -urN b/internal/mod/lazyregexp/BUILD.bazel c/internal/mod/lazyregexp/BUILD.bazel ---- b/internal/mod/lazyregexp/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/internal/mod/lazyregexp/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,14 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library") -+ -+go_library( -+ name = "lazyregexp", -+ srcs = ["lazyre.go"], -+ importpath = "golang.org/x/tools/internal/mod/lazyregexp", -+ visibility = ["//:__subpackages__"], -+) -+ -+alias( -+ name = "go_default_library", -+ actual = ":lazyregexp", -+ visibility = ["//:__subpackages__"], -+) -diff -urN b/internal/mod/modfile/BUILD.bazel c/internal/mod/modfile/BUILD.bazel ---- b/internal/mod/modfile/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/internal/mod/modfile/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,22 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library") -+ -+go_library( -+ name = "modfile", -+ srcs = [ -+ "read.go", -+ "rule.go", -+ ], -+ importpath = "golang.org/x/tools/internal/mod/modfile", -+ visibility = ["//:__subpackages__"], -+ deps = [ -+ "//internal/mod/lazyregexp", -+ "@org_golang_x_mod//modfile:go_default_library", -+ "@org_golang_x_mod//module:go_default_library", -+ ], -+) -+ -+alias( -+ name = "go_default_library", -+ actual = ":modfile", -+ visibility = ["//:__subpackages__"], -+) diff -urN b/internal/packagesinternal/BUILD.bazel c/internal/packagesinternal/BUILD.bazel ---- b/internal/packagesinternal/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/packagesinternal/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/packagesinternal/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12163,7 +13266,7 @@ diff -urN b/internal/packagesinternal/BUILD.bazel c/internal/packagesinternal/BU + visibility = ["//:__subpackages__"], +) diff -urN b/internal/proxydir/BUILD.bazel c/internal/proxydir/BUILD.bazel ---- b/internal/proxydir/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/proxydir/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/proxydir/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12188,9 +13291,9 @@ diff -urN b/internal/proxydir/BUILD.bazel c/internal/proxydir/BUILD.bazel + embed = [":proxydir"], +) diff -urN b/internal/span/BUILD.bazel c/internal/span/BUILD.bazel ---- b/internal/span/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/span/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/span/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,34 @@ +@@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( @@ -12199,13 +13302,12 @@ diff -urN b/internal/span/BUILD.bazel c/internal/span/BUILD.bazel + "parse.go", + "span.go", + "token.go", -+ "token111.go", -+ "token112.go", + "uri.go", + "utf16.go", + ], + importpath = "golang.org/x/tools/internal/span", + visibility = ["//:__subpackages__"], ++ deps = ["//internal/lsp/bug"], +) + +alias( @@ -12226,7 +13328,7 @@ diff -urN b/internal/span/BUILD.bazel c/internal/span/BUILD.bazel + deps = [":span"], +) diff -urN b/internal/stack/BUILD.bazel c/internal/stack/BUILD.bazel ---- b/internal/stack/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/stack/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/stack/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12254,7 +13356,7 @@ diff -urN b/internal/stack/BUILD.bazel c/internal/stack/BUILD.bazel + deps = [":stack"], +) diff -urN b/internal/stack/gostacks/BUILD.bazel c/internal/stack/gostacks/BUILD.bazel ---- b/internal/stack/gostacks/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/stack/gostacks/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/stack/gostacks/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") @@ -12273,7 +13375,7 @@ diff -urN b/internal/stack/gostacks/BUILD.bazel c/internal/stack/gostacks/BUILD. + visibility = ["//:__subpackages__"], +) diff -urN b/internal/stack/stacktest/BUILD.bazel c/internal/stack/stacktest/BUILD.bazel ---- b/internal/stack/stacktest/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/stack/stacktest/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/stack/stacktest/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12292,17 +13394,14 @@ diff -urN b/internal/stack/stacktest/BUILD.bazel c/internal/stack/stacktest/BUIL + visibility = ["//:__subpackages__"], +) diff -urN b/internal/testenv/BUILD.bazel c/internal/testenv/BUILD.bazel ---- b/internal/testenv/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/testenv/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/testenv/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,18 @@ +@@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "testenv", -+ srcs = [ -+ "testenv.go", -+ "testenv_112.go", -+ ], ++ srcs = ["testenv.go"], + importpath = "golang.org/x/tools/internal/testenv", + visibility = ["//:__subpackages__"], + deps = ["@org_golang_x_sys//execabs:go_default_library"], @@ -12314,7 +13413,7 @@ diff -urN b/internal/testenv/BUILD.bazel c/internal/testenv/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/tool/BUILD.bazel c/internal/tool/BUILD.bazel ---- b/internal/tool/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/tool/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/tool/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12332,15 +13431,16 @@ diff -urN b/internal/tool/BUILD.bazel c/internal/tool/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/internal/typeparams/BUILD.bazel c/internal/typeparams/BUILD.bazel ---- b/internal/typeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/typeparams/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/typeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,37 @@ +@@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "typeparams", + srcs = [ + "common.go", ++ "coretype.go", + "enabled_go117.go", + "enabled_go118.go", + "normalize.go", @@ -12363,6 +13463,7 @@ diff -urN b/internal/typeparams/BUILD.bazel c/internal/typeparams/BUILD.bazel + name = "typeparams_test", + srcs = [ + "common_test.go", ++ "coretype_test.go", + "normalize_test.go", + "typeparams_test.go", + ], @@ -12372,26 +13473,8 @@ diff -urN b/internal/typeparams/BUILD.bazel c/internal/typeparams/BUILD.bazel + "//internal/testenv", + ], +) -diff -urN b/internal/typeparams/example/findtypeparams/BUILD.bazel c/internal/typeparams/example/findtypeparams/BUILD.bazel ---- b/internal/typeparams/example/findtypeparams/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 -+++ c/internal/typeparams/example/findtypeparams/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,14 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") -+ -+go_library( -+ name = "findtypeparams_lib", -+ srcs = ["main.go"], -+ importpath = "golang.org/x/tools/internal/typeparams/example/findtypeparams", -+ visibility = ["//visibility:private"], -+) -+ -+go_binary( -+ name = "findtypeparams", -+ embed = [":findtypeparams_lib"], -+ visibility = ["//:__subpackages__"], -+) diff -urN b/internal/typeparams/genericfeatures/BUILD.bazel c/internal/typeparams/genericfeatures/BUILD.bazel ---- b/internal/typeparams/genericfeatures/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/typeparams/genericfeatures/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/typeparams/genericfeatures/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12413,9 +13496,9 @@ diff -urN b/internal/typeparams/genericfeatures/BUILD.bazel c/internal/typeparam + visibility = ["//:__subpackages__"], +) diff -urN b/internal/typesinternal/BUILD.bazel c/internal/typesinternal/BUILD.bazel ---- b/internal/typesinternal/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/typesinternal/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/typesinternal/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 -@@ -0,0 +1,18 @@ +@@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -12424,6 +13507,7 @@ diff -urN b/internal/typesinternal/BUILD.bazel c/internal/typesinternal/BUILD.ba + "errorcode.go", + "errorcode_string.go", + "types.go", ++ "types_118.go", + ], + importpath = "golang.org/x/tools/internal/typesinternal", + visibility = ["//:__subpackages__"], @@ -12435,7 +13519,7 @@ diff -urN b/internal/typesinternal/BUILD.bazel c/internal/typesinternal/BUILD.ba + visibility = ["//:__subpackages__"], +) diff -urN b/internal/xcontext/BUILD.bazel c/internal/xcontext/BUILD.bazel ---- b/internal/xcontext/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/internal/xcontext/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/internal/xcontext/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12453,7 +13537,7 @@ diff -urN b/internal/xcontext/BUILD.bazel c/internal/xcontext/BUILD.bazel + visibility = ["//:__subpackages__"], +) diff -urN b/playground/BUILD.bazel c/playground/BUILD.bazel ---- b/playground/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/playground/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/playground/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12471,7 +13555,7 @@ diff -urN b/playground/BUILD.bazel c/playground/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/playground/socket/BUILD.bazel c/playground/socket/BUILD.bazel ---- b/playground/socket/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/playground/socket/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/playground/socket/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12500,7 +13584,7 @@ diff -urN b/playground/socket/BUILD.bazel c/playground/socket/BUILD.bazel + embed = [":socket"], +) diff -urN b/present/BUILD.bazel c/present/BUILD.bazel ---- b/present/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/present/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/present/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12548,7 +13632,7 @@ diff -urN b/present/BUILD.bazel c/present/BUILD.bazel + embed = [":present"], +) diff -urN b/refactor/eg/BUILD.bazel c/refactor/eg/BUILD.bazel ---- b/refactor/eg/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/refactor/eg/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/refactor/eg/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,93 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12645,7 +13729,7 @@ diff -urN b/refactor/eg/BUILD.bazel c/refactor/eg/BUILD.bazel + }), +) diff -urN b/refactor/importgraph/BUILD.bazel c/refactor/importgraph/BUILD.bazel ---- b/refactor/importgraph/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/refactor/importgraph/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/refactor/importgraph/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,75 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12724,7 +13808,7 @@ diff -urN b/refactor/importgraph/BUILD.bazel c/refactor/importgraph/BUILD.bazel + }), +) diff -urN b/refactor/rename/BUILD.bazel c/refactor/rename/BUILD.bazel ---- b/refactor/rename/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/refactor/rename/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/refactor/rename/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") @@ -12770,7 +13854,7 @@ diff -urN b/refactor/rename/BUILD.bazel c/refactor/rename/BUILD.bazel + ], +) diff -urN b/refactor/satisfy/BUILD.bazel c/refactor/satisfy/BUILD.bazel ---- b/refactor/satisfy/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/refactor/satisfy/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/refactor/satisfy/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") @@ -12792,7 +13876,7 @@ diff -urN b/refactor/satisfy/BUILD.bazel c/refactor/satisfy/BUILD.bazel + visibility = ["//visibility:public"], +) diff -urN b/txtar/BUILD.bazel c/txtar/BUILD.bazel ---- b/txtar/BUILD.bazel 1969-12-31 16:00:00.000000000 -0800 +--- b/txtar/BUILD.bazel 1970-01-01 01:00:00.000000000 +0100 +++ c/txtar/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")