Skip to content

Commit 8bb3ae1

Browse files
committed
cmd/vendor: eliminate vet-lite
cmd/vet, now simplified to a single function call is now authoritative, not a copy of vet-lite. The update-xtools.sh script now uses the imports of cmd/vet as the roots for vendoring. Change-Id: I4faef3fcf3db10b3a3930726e8d0720a3c8395da Reviewed-on: https://go-review.googlesource.com/c/150297 Run-TryBot: Alan Donovan <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent 42b4658 commit 8bb3ae1

File tree

2 files changed

+8
-78
lines changed

2 files changed

+8
-78
lines changed

src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/cmd/vendor/update-xtools.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
#
33
# update-xtools.sh: idempotently update the vendored
4-
# copy of the x/tools repository used by vet-lite.
4+
# copy of the x/tools repository used by cmd/vet.
55

66
set -u
77

@@ -11,7 +11,11 @@ xtools=$(dirname $(dirname $analysis))
1111

1212
vendor=$(dirname $0)
1313

14-
go list -f '{{.ImportPath}} {{.Dir}}' -deps golang.org/x/tools/go/analysis/cmd/vet-lite |
14+
# Find the x/tools packages directly imported by cmd/vet.
15+
go list -f '{{range $k, $v := .ImportMap}}{{$k}} {{end}}' cmd/vet |
16+
grep golang.org/x/tools |
17+
# Vendor their transitive closure of dependencies.
18+
xargs go list -f '{{.ImportPath}} {{.Dir}}' -deps |
1519
grep golang.org/x/tools |
1620
while read path dir
1721
do
@@ -23,5 +27,5 @@ go list -f '{{.ImportPath}} {{.Dir}}' -deps golang.org/x/tools/go/analysis/cmd/v
2327

2428
echo "Copied $xtools@$(cd $analysis && git rev-parse --short HEAD) to $vendor" >&2
2529

26-
go build -o /dev/null ./golang.org/x/tools/go/analysis/cmd/vet-lite ||
27-
{ echo "Failed to build vet-lite"; exit 1; } >&2
30+
go build -o /dev/null cmd/vet ||
31+
{ echo "Failed to build cmd/vet"; exit 1; } >&2

0 commit comments

Comments
 (0)