1
0
mirror of https://github.com/golang/go synced 2024-10-04 19:21:21 -06:00
Commit Graph

103 Commits

Author SHA1 Message Date
Aliaksandr Valialkin
dcc42c7d11 cmd/vet: do not check print-like functions with unknown type
Fixes #15787

Change-Id: I559ba886527b474dbdd44fe884c78973b3012377
Reviewed-on: https://go-review.googlesource.com/23351
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-05-24 16:13:44 +00:00
Aliaksandr Valialkin
c81a3532fe cmd/vet: check sync.* types' copying
Embed noLock struct into the following types, so `go vet -copylocks` catches
their copying additionally to types containing sync.Mutex:
  - sync.Cond
  - sync.WaitGroup
  - sync.Pool
  - atomic.Value

Fixes #14582

Change-Id: Icb543ef5ad10524ad239a15eec8a9b334b0e0660
Reviewed-on: https://go-review.googlesource.com/22015
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-06 16:43:51 +00:00
Shenghou Ma
7a964e1df4 cmd/vet: add mips64x assembly check support
Change-Id: I0a6a92604dbfa4b0f9c5ae483b574331f246dcad
Reviewed-on: https://go-review.googlesource.com/22502
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-05-04 16:50:13 +00:00
Brad Fitzpatrick
4d5ac10f69 cmd/vet: fix test's dependence on perl
Change-Id: I774dbd4f90ef271a0969c3c8e65d145669312e3e
Reviewed-on: https://go-review.googlesource.com/22745
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ross Light <light@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-03 23:59:56 +00:00
Aliaksandr Valialkin
22db3c5a62 cmd/vet: improve checking unkeyed fields in composite literals
- Simplified the code.

- Removed types for slice aliases from composite literals' whitelist, since they
are properly handled by vet.

Fixes #15408
Updates #9171
Updates #11041

Change-Id: Ia1806c9eb3f327c09d2e28da4ffdb233b5a159b0
Reviewed-on: https://go-review.googlesource.com/22318
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-04-28 13:51:40 +00:00
Matthew Dempsky
1441f76938 cmd: remove unnecessary type conversions
CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: Ic590315cbc7026163a1b3f8ea306ba35f1a53256
Reviewed-on: https://go-review.googlesource.com/22103
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-04-15 02:32:10 +00:00
Josh Bleecher Snyder
67cdec00c2 cmd/vet: teach asm checker about PEXTRD’s op size
Fixes #15271

Change-Id: I28e3fb5bde1e6fd5b263b1434873b8ce051aee97
Reviewed-on: https://go-review.googlesource.com/22083
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-04-14 17:58:51 +00:00
Luan Santos
8d8feb4d2f cmd/vet: allow untyped composite literals to be unkeyed
We can trust that untyped composite literals are part of a slice literal
and not emit a vet warning for those.

Fixes #9171

Change-Id: Ia7c081e543b850f8be1fd1f9e711520061e70bed
Reviewed-on: https://go-review.googlesource.com/22000
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-04-14 16:20:58 +00:00
Rob Pike
d1feddb7ae cmd/vet: improve documentation for flags, slightly
The way that -all works was unclear from the documentation and made
worse by recent changes to the flag package. Improve matters by making
the help message say "default true" for the tests that do default to true,
and tweak some of the wording.

Before:

Usage of vet:
	vet [flags] directory...
	vet [flags] files... # Must be a single package
For more information run
	go doc cmd/vet

Flags:
  -all
    	enable all non-experimental checks (default unset)
  -asmdecl
    	check assembly against Go declarations (default unset)
...

After:

Usage of vet:
	vet [flags] directory...
	vet [flags] files... # Must be a single package
By default, -all is set and all non-experimental checks are run.
For more information run
	go doc cmd/vet

Flags:
  -all
    	enable all non-experimental checks (default true)
  -asmdecl
    	check assembly against Go declarations (default true)
...

Change-Id: Ie94b27381a9ad2382a10a7542a93bce1d59fa8f5
Reviewed-on: https://go-review.googlesource.com/21495
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-04-11 22:35:22 +00:00
David Symonds
e6a8daceb0 cmd/vet: refresh command for updating whitelist data.
This excludes internal and testdata packages, as well as func types.

No new whitelist entries were found.

Change-Id: Ie7d42ce0a235394e4bcabf09e155726a35cd2d3d
Reviewed-on: https://go-review.googlesource.com/21822
Reviewed-by: Rob Pike <r@golang.org>
2016-04-11 00:39:53 +00:00
Aliaksandr Valialkin
d7ddee78dd icmd/vet: improved checking for variadic Println-like functions
- Automatically determine the first argument to check.
- Skip checking matching non-variadic functions.
- Skip checking matching functions accepting non-interface{}
  variadic arguments.
- Removed fragile 'magic' code for special cases such as math.Log
  and error interface.

Fixes #15067
Fixes #15099

Change-Id: Ib313557f18b12b36daa493f4b02c598b9503b55b
Reviewed-on: https://go-review.googlesource.com/21513
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-04-06 18:11:36 +00:00
Konstantin Shaposhnikov
0d37538196 cmd/vet: do not treat declaration as asignment in atomic check
Fixes #15118

Change-Id: Iad56ed412535c8ac0a01c4bd7769fd3d37688ac9
Reviewed-on: https://go-review.googlesource.com/21526
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-04-06 16:38:24 +00:00
Aliaksandr Valialkin
72a1b53b67 cmd/vet: allow lock types inside built-in new()
Updates #14839
Fixes #14994

Change-Id: I9bb51bad19105a17c80d690c5486e5dd007ac84a
Reviewed-on: https://go-review.googlesource.com/21222
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-30 00:16:48 +00:00
Aliaksandr Valialkin
ee1b90ad2c cmd/vet: improve detecting printf-like format argument
Previously format argument was detected via scanning func type args.
This didn't work when func type couldn't be determined if the func
is declared in the external package. Fall back to scanning for
the first string call argument in this case.

Fixes #14754

Change-Id: I571cc29684cc641bc87882002ef474cf1481e9e2
Reviewed-on: https://go-review.googlesource.com/21023
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-29 23:40:52 +00:00
Dominik Honnef
4ffa5eb876 cmd/vet: don't treat fields like variables in rangeloop check
Fixes #13236

Change-Id: If902ac66718e0a0790fab9835921ce4ef980965b
Reviewed-on: https://go-review.googlesource.com/21183
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-27 05:31:54 +00:00
Aliaksandr Valialkin
1374515a1c cmd/vet: check lock copy in function calls and return statements
Fixes #14529

Change-Id: I6ed059d279ba0fe12d76416859659f28d61781d2
Reviewed-on: https://go-review.googlesource.com/20832
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-23 07:14:26 +00:00
Hyang-Ah Hana Kim
50487b2c8d cmd/pack,vet: use go doc instead of godoc in doc
Change-Id: Ic5f62a7d0a5c090da69213d1d0187af0ea48e358
Reviewed-on: https://go-review.googlesource.com/20820
Reviewed-by: Rob Pike <r@golang.org>
2016-03-17 21:06:40 +00:00
Aliaksandr Valialkin
fee86e4aa8 cmd/vet: added some missing copylock checks
Fixes #14664

Change-Id: I8bda2435857772f590859808904c48d768b87d46
Reviewed-on: https://go-review.googlesource.com/20254
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-16 05:12:48 +00:00
Konstantin Shaposhnikov
b8a2e25f55 cmd/vet: remove -test flag
-test flag is a testing only flag that enables all vet checks. It was needed
because there was no way to run all vet checks in a single command
invocation. However it is possible to do this now by combining -all and -shadow
flags.

Also a recently added -tests flag is similarly named, having both -test and
-tests can be confusing.

Change-Id: Ie5bacbe0bef5c8409eeace46f16141fa4e782c32
Reviewed-on: https://go-review.googlesource.com/20006
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-07 22:54:38 +00:00
Spencer Nelson
867910ea17 cmd/vet: Use function signature to find format string index.
cmd/vet's printf checker currently uses a hardcoded map of function
names to expected positions of format strings. We can be a bit more
precise than this by looking up the signature of the function, which
helps when libraries implement functions like Errorf or Logf with
extra arguments like log levels or error codes.

Specifically, the format string param is assumed to be the last string
parameter of the called function.

Fixes #12294.

Change-Id: Icf10ebb819bba91fa1c4109301417042901e34c7
Reviewed-on: https://go-review.googlesource.com/20163
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-03-04 00:00:20 +00:00
Marvin Stenger
a8d4463e50 cmd/vet: polish output of shadow test
This commit modifies the style of a error message in case of -shadow.

Previously such a message would look like:
foo.go:42: declaration of err shadows declaration at shadow.go:13:

Changes of the commit include highlighting the variable name and
removing the ": "(space intended) at the end of the line:
foo.go:42: declaration of "err" shadows declaration at shadow.go:13

Fixes #14585.

Change-Id: Ia6a6bf396668dcba9a24f025a08d8826db31f434
Reviewed-on: https://go-review.googlesource.com/20093
Reviewed-by: Rob Pike <r@golang.org>
2016-03-02 00:49:39 +00:00
Brad Fitzpatrick
5fea2ccc77 all: single space after period.
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.

This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:

$ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')
$ go test go/doc -update

Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-02 00:13:47 +00:00
Brad Fitzpatrick
519474451a all: make copyright headers consistent with one space after period
This is a subset of https://golang.org/cl/20022 with only the copyright
header lines, so the next CL will be smaller and more reviewable.

Go policy has been single space after periods in comments for some time.

The copyright header template at:

    https://golang.org/doc/contribute.html#copyright

also uses a single space.

Make them all consistent.

Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0
Reviewed-on: https://go-review.googlesource.com/20111
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-01 23:34:33 +00:00
Rob Pike
998aaf8a64 cmd/vet: add a README explaining the criteria for new checks
Correctness, Frequency, Precision.

Change-Id: I7f202c220aef8512d611dc04a4370b4a237f217c
Reviewed-on: https://go-review.googlesource.com/20003
Reviewed-by: Russ Cox <rsc@golang.org>
2016-03-01 20:48:20 +00:00
Catalin Nicutar
6e6637bdb4 cmd/vet: add a check for tests with malformed names
According to golang.org/pkg/testing the first character after Test has
to be non-lowercase. Functions that don't conform to this are not
considered tests and are not loaded which can cause surprises.

This change adds a check to warn about Test-like functions in a _test
file that are not actually run by go test.

Moved over from https://go-review.googlesource.com/#/c/19466/

Change-Id: I2f89676058b27a0e35f721bdabc9fa8a9d34430d
Reviewed-on: https://go-review.googlesource.com/19724
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-02-24 10:40:34 +00:00
Ian Lance Taylor
182a9db2dc cmd/vet: don't crash in cgo checker if type is unknown
Fixes #14201.

Change-Id: Ib61f8c00cae72463f59b90ae199fbdc1e7422a79
Reviewed-on: https://go-review.googlesource.com/19174
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-02-03 03:34:02 +00:00
Russ Cox
0f89efa255 cmd/vet: report uncalled functions in Printf %v
Given, say, var f *os.File, a new vet check in CL 14122 diagnoses:

	fmt.Printf("%s\n", f.Name)
	fmt.Println(f.Name)

but not

	fmt.Printf("%v\n", f.Name)

In all three cases the error is that the argument should be f.Name().

Diagnosing Println but not Printf %v seems oddly inconsistent,
so I changed %v to have the check too. In fact, all verbs now have
the check except %p and %T.

Fixes Dave Cheney's confusion when trying to write an example
of the new vet check advertised in the Go 1.6 release notes.

Change-Id: I92fa6a7a1d5d9339a6a59ae4e587a254e633f500
Reviewed-on: https://go-review.googlesource.com/19101
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-01-29 17:01:47 +00:00
Ian Lance Taylor
ebf64bcc24 cmd/vet: add some checks for invalid pointer passing using cgo
Update #12416.

Change-Id: I21d97cbe211ccc8048e5a78ea4d89664f4d195ba
Reviewed-on: https://go-review.googlesource.com/17041
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-18 00:31:21 +00:00
Russ Cox
5b1a8a5239 cmd/vet: move cmd/vet/whitelist to cmd/vet/internal/whitelist
This was a mistake made when bringing cmd/vet into the main repo.

Fixes #13416.

Change-Id: I03b512ab944577c56085aea06df8ff5e1acc16d7
Reviewed-on: https://go-review.googlesource.com/17455
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2015-12-05 06:26:17 +00:00
Konstantin Shaposhnikov
3fb9e08758 cmd/vet: make "-all -shadow" mean all default checks and -shadow
Prior to this change "go tool vet -all -shadow" ran only -shadow check.

Also fix godoc package path in the usage text.

Fixes #13020

Change-Id: I87c60d6b06a02106ae8bff56adb79df032cc4646
Reviewed-on: https://go-review.googlesource.com/16325
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-05 04:07:36 +00:00
David Crawshaw
dc9ad5861d cmd/vet: use testenv
Fix for iOS builder.

Change-Id: I5b6c977b187446c848182a9294d5bed6b5f9f6e4
Reviewed-on: https://go-review.googlesource.com/16633
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-11-04 15:59:10 +00:00
Konstantin Shaposhnikov
3c1712db0b cmd/vet: fix shadow assignment check with complex rhs
This change fixes shadow assignment check in cases when RHS is not an identifier
or a type assertion.

Fixes #12188

Change-Id: I0940df8d9c237ab8b8d3272eb6895e676c75c115
Reviewed-on: https://go-review.googlesource.com/16038
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-21 14:27:49 +00:00
Rob Pike
ebd96933c1 cmd/vet: build the binary only once in the test
Recent changes caused vet to build the binary for each Test function.
This is wasteful and will become only more so as more tests are added.
Use testing.Main to build only once.

Verified that compilation errors still appear if the binary cannot be
built.

Before:
	real	0m11.169s
	user	0m18.328s
	sys	0m2.152s

After:
	real	0m5.132s
	user	0m9.404s
	sys	0m1.168s

Of course if the compiler were fast we might not notice, but vet is
a big program and growing bigger all the time, as are the tests.

Change-Id: I209a8fdcace94bc5cec946f5dd365d7191f44c02
Reviewed-on: https://go-review.googlesource.com/14822
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-21 20:20:32 +00:00
Rob Pike
7454f53604 cmd/vet: copy changes from golang.org/x/tools to cmd/vet
This means bringing over the examples flag and sorting doc.go.

Subsequent changes will generalize the examples flag to a general
test naming flag, but let's start with the original code.

No more changes to golang.org/x/tools please. This should not have
happened (and letting it happen was partly my fault).

Change-Id: Ia879ea1d15d82372df14853f919263125dfb7b96
Reviewed-on: https://go-review.googlesource.com/14821
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-21 17:48:38 +00:00
Russ Cox
d8384e9a8f cmd/vet: diagnose plain assignment in copylock detector
It went out of its way to look for implicit assignments
but never checked explicit assignments.

This detects the root bug for #12099.

Change-Id: I6a6e774cc38749ea8be7cfd58ba6421247b67000
Reviewed-on: https://go-review.googlesource.com/13646
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-09-10 16:55:51 +00:00
Rob Pike
43a7a9cf43 cmd/vet: diagnose using Printf on a function value
Printing a function value is nearly useless outside of debugging, but
can occur by mistake when one forgets to call it. Diagnose this.

I did this myself just the other day and it arose in cl/14031.
Easy to fix and seems worthwhile.

Fixes #12295.

Change-Id: Ice125a84559f0394f7fa7272b5d31ae602b07f83
Reviewed-on: https://go-review.googlesource.com/14122
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-02 17:58:04 +00:00
Russ Cox
6f0c7df8ed cmd/vet: power64 is now ppc64
This was missed when we did the rename months ago
because cmd/vet did not live in the main tree.
Now vet's asmdecl checks will apply to ppc64 assembly too.

Change-Id: I687cba89fef702f29dd118de76a7ca1041c414f6
Reviewed-on: https://go-review.googlesource.com/13677
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-08-18 17:00:59 +00:00
Brad Fitzpatrick
2ae77376f7 all: link to https instead of http
The one in misc/makerelease/makerelease.go is particularly bad and
probably warrants rotating our keys.

I didn't update old weekly notes, and reverted some changes involving
test code for now, since we're late in the Go 1.5 freeze. Otherwise,
the rest are all auto-generated changes, and all manually reviewed.

Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d
Reviewed-on: https://go-review.googlesource.com/12048
Reviewed-by: Rob Pike <r@golang.org>
2015-07-11 14:36:33 +00:00
Rob Pike
98c9e9e74f cmd/vet: refer info about -printfuncs to the -printf flag
And vice versa.

The flags are tightly coupled so make the connection clear.

Change-Id: I505f76be631ffa6e489a441c2f3c717aa09ec802
Reviewed-on: https://go-review.googlesource.com/11324
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-22 20:42:01 +00:00
Russ Cox
7bc3e58806 all: extract "can I exec?" check from tests into internal/testenv
Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d
Reviewed-on: https://go-review.googlesource.com/10753
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-16 18:07:36 +00:00
Robert Griesemer
d63c42df25 go/types: port recent x/tools/go/types fixes
The main change is:

golang.org/cl/10800  add pos parameter to Eval; remove New, EvalNode

followed by several cleanups/follow-up fixes:

golang.org/cl/10992  remove global vars in test
golang.org/cl/10994  remove unused scope parameter from NewSignature
golang.org/cl/10995  provide full source file extent to file scope
golang.org/cl/10996  comment fix in resolver.go
golang.org/cl/11004  updated cmd/vet
golang.org/cl/11042  be robust in the presence of incorrect/missing position info

Fixes #9980.

Change-Id: Id4aff688f6a399f76bf92b84c7e793b8da8baa48
Reviewed-on: https://go-review.googlesource.com/11122
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-06-15 20:11:37 +00:00
Josh Bleecher Snyder
ff8f3f0fa1 cmd/vet: extend copylocks to anonymous functions
Running -copylocks over a large corpus generates 1507 warnings.
Of those, only 3 are from the new anonymous function check,
but they are all bugs.

Fixes #10927.

Change-Id: I2672f6871036bed711beec5f88bc39aa8b3b6a94
Reviewed-on: https://go-review.googlesource.com/11051
Reviewed-by: Rob Pike <r@golang.org>
2015-06-13 03:07:43 +00:00
Brad Fitzpatrick
a788c913fa cmd/vet: skip another test on Android
Forgot this one in my previous commit.

Change-Id: Ief089e99bdad24b3bcfb075497dc259d06cc727c
Reviewed-on: https://go-review.googlesource.com/10913
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-11 16:30:56 +00:00
Brad Fitzpatrick
0beb931c76 cmd/go, cmd/vet: skip tests on Android
Might get the Android build passing, or at least going further.

Change-Id: I08f97156a687abe5a3d95203922f4ffd84fbb212
Reviewed-on: https://go-review.googlesource.com/10924
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-11 14:33:40 +00:00
Robert Griesemer
13e2412876 cmd/vet: remove dependency on types.New
- remove TODO on non-existing fmt.Formatter type
  (type exists now)
- guard uses of imported types against nil

Change-Id: I9ae8e5a448e73c84dec1606ea9d9ed5ddeee8dc6
Reviewed-on: https://go-review.googlesource.com/10777
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-06-08 20:52:07 +00:00
Alex Brainman
a58e731287 cmd/vet: fix tests on windows
Add .exe to exectable name, so it can be executed on windows.
Use proper windows paths when searching vet output.
Replace Skip with Skipf.

Fixes build

Change-Id: Ife40d8f5ab9d7093ca61c50683a358d4d6a3ba34
Reviewed-on: https://go-review.googlesource.com/10742
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Patrick Mézard <patrick@mezard.eu>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-08 15:14:39 +00:00
Russ Cox
95919328ac cmd/vet: skip exec tests on systems that can't exec
Change-Id: I09257b8f5482cba10b5f4d3813c778d6e9e74d40
Reviewed-on: https://go-review.googlesource.com/10752
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-05 14:35:13 +00:00
Robert Griesemer
a7d2d4835b cmd/vet: adjust vet to use go/types and friends from std repo
- s|"golang.org/x/tools/go/exact"|"go/constant"|
- s|"golang.org/x/tools/go/types"|"go/types"|
- removed import of gcimporter
- import "go/importer" instead
- trivial adjustments to make use of go/importer
- adjusted import paths for whitelist.go

Change-Id: I43488ff44c329cd869c92dcc31193fb31bebfd29
Reviewed-on: https://go-review.googlesource.com/10695
Reviewed-by: Rob Pike <r@golang.org>
2015-06-04 21:24:52 +00:00
Robert Griesemer
1b8b2c1551 cmd/vet: move cmd/vet into std repo
cp -r x/tools/cmd/vet cmd/vet without any changes.
The next change will adjust the source to use std
repo go/types and friends.

This may (temporarily) break the build; the next
commit (immediately following) will fix it. We do
it in two commits so that we can see the manual
changes.

Change-Id: Ic45dab7066f13923e21f8c61200c8c3fd447b171
Reviewed-on: https://go-review.googlesource.com/10694
Reviewed-by: Rob Pike <r@golang.org>
2015-06-04 21:22:13 +00:00
Rob Pike
249842c8db cmd/vet: delete; it now lives in the go.tools subrepo
R=golang-dev, dsymonds, rsc, iant, dave
CC=golang-dev
https://golang.org/cl/9496043
2013-05-17 13:53:22 -07:00