App Engine needs the whitelist file and it's cleaner if it's
in its own package where it can be imported directly, without
pushing composite.go through a pile of sed.
R=dsymonds, r
CC=golang-dev
https://golang.org/cl/12746045
TBR: gri
I cannot create an issue on the tracker for some reason, so here it is:
go vet contains this snippet:
if types.IsAssignableTo(typ, errorType) || types.IsAssignableTo(typ, stringerType) {
It's getting the wrong answer: It claims
interface {
f()
}
or even
interface {
f() float64
}
matches the Error and Stringer interfaces. Both of them. This causes a test failure:
$ go test code.google.com/p/go.tools/cmd/vet
BUG: errchk: testdata/print.go:124: missing expected error: '"for printf verb %s of wrong type"'
$
This worked until very recently.
R=gri
CC=golang-dev
https://golang.org/cl/12398043
The old code only got it right for Stringers (etc.) and a few other simple cases.
But the rule used by fmt.Printf for non-Stringers is that pointers to structs
print as pointers, the rest must satisfy the format verb element-wise.
Thus for example
struct {a int, b []byte}
prints with %d and %q (sic) but not %g.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12340043
The analysis for types.Array was just missing. It's the same as a slice,
but we can't share code easily because the types differ, so we just dup it.
R=dsymonds
CC=golang-dev
https://golang.org/cl/12041045
First, %v and %T accept any arguments, so they should never warn.
Second, pointer types were not handled in matchArgType.
Third, the default response for matchArgType should be false.
R=r
CC=adonovan, golang-dev
https://golang.org/cl/12038050
I'd like to make vet work as a filter, but passing /dev/stdin as a
command line argument doesn't work. This at least makes it not panic.
R=r
CC=golang-dev
https://golang.org/cl/11521045
Allmost all uses of go/types that wanted the type
information computed, installed callback functions
that stored the information in maps. Most of the
time this is the only thing that could be done because
there is no guarantee that types are completely set
up before the end of type-checking.
This CL removes the respective Context callbacks in favor
of corresponding maps that collect the desired information
on demand, grouped together in an optional Info struct.
R=adonovan
CC=golang-dev
https://golang.org/cl/11530044
Details:
- added support for complex numbers as distinct from floats:
%[efg] allows complex; %b does not.
- %p: only Signature, Map, Chan, Slice, unsafe.Pointer allowed.
- %s: allow []byte.
- allow a verb to match map[K]V and []T if it matches K/V/T,
e.g. %d now matches []int. i.e. matching is recursive.
- use go/types' constant folding. literal() is gone.
- group cases together.
Added tests.
R=gri, r
CC=golang-dev
https://golang.org/cl/10895043
Experimental feature. It's too noisy yet to be enabled by default,
so it must be enabled explicitly by
go tool vet -shadow *.go
or
go tool vet -shadow directory
(The go command does not know about the -shadow flag.)
Fixesgolang/go#5634.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/10409047
Before:
math/big/nat_test.go:688: arg r for printf verb %s of wrong type: ..Word
After:
math/big/nat_test.go:688: arg r for printf verb %s of wrong type: big.Word
R=gri
CC=golang-dev
https://golang.org/cl/10400044
A trailing % resulted in a bad error message.
Also clean up a couple of dregs left over from the
refactoring to add indexed formats.
R=dsymonds
CC=golang-dev
https://golang.org/cl/10336044
Rewrite the checker to be more flexible and better documented, being
more explicit about parsed format vs. checked arguments.
No attempt yet to do check indexed formats; this just paves the way.
All tests still pass.
R=gri
CC=golang-dev
https://golang.org/cl/9881044
Can't reproduce the failure outside the builder, but attempt a fix
by changing the criterion for failure: FAIL iff the output contains "BUG".
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9798050
Simplify the code a bit, get it working after recent go/types changes,
and handle "%*%" just in case. Preparation for handling argument indexing.
R=gri
CC=golang-dev
https://golang.org/cl/9747045
- remove Makefile
- move test data into a subdirectory
- encapsulate the invocation of errchk into a standard Test using os.exec
R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/9509045
Now that it's in the same repository as the go/types package we can delete
the mechanism to build it without type checking.
Add a make rule to install it where the go tool can find it.
Why doesn't "go install" take a -o flag?
R=gri
CC=gobot, golang-dev
https://golang.org/cl/9526043
They will be deleted from their current homes once this has landed.
Changes made to import paths to make the code compile, and to find
errchk in the right place in cmd/vet's Makefile.
TODO in a later CL: tidy up vet.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9495043