go.tools/cmd/vet: improvements to static checking of printf calls.
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.
I assure you vet uses go/types: % cd go.tools/cmd/vet /Users/r/src/code.google.com/p/go.tools/cmd/vet % g go.types main.go:25: "code.google.com/p/go.tools/go/types" ...
11 years, 5 months ago
(2013-07-03 02:04:01 UTC)
#2
I assure you vet uses go/types:
% cd go.tools/cmd/vet
/Users/r/src/code.google.com/p/go.tools/cmd/vet
% g go.types
main.go:25: "code.google.com/p/go.tools/go/types"
shadow.go:37: "code.google.com/p/go.tools/go/types"
types.go:5: // This file contains the pieces of the tool that use
typechecking from the go/types package.
types.go:14: "code.google.com/p/go.tools/go/types"
types.go:73: // TODO: Simplify when we have the IsAssignableTo
predicate in go/types.
%
-rob
D'oh. On 2 July 2013 22:03, Rob Pike <r@golang.org> wrote: > I assure you vet ...
11 years, 5 months ago
(2013-07-03 14:43:15 UTC)
#3
D'oh.
On 2 July 2013 22:03, Rob Pike <r@golang.org> wrote:
> I assure you vet uses go/types:
>
> % cd go.tools/cmd/vet
> /Users/r/src/code.google.com/p/go.tools/cmd/vet
> % g go.types
> main.go:25: "code.google.com/p/go.tools/go/types"
> shadow.go:37: "code.google.com/p/go.tools/go/types"
> types.go:5: // This file contains the pieces of the tool that use
> typechecking from the go/types package.
> types.go:14: "code.google.com/p/go.tools/go/types"
> types.go:73: // TODO: Simplify when we have the IsAssignableTo
> predicate in go/types.
> %
>
> -rob
>
On 2013/07/12 22:16:31, r wrote: > CL description needs updating too Done; PTAL. (Was it ...
11 years, 5 months ago
(2013-07-15 17:41:15 UTC)
#10
On 2013/07/12 22:16:31, r wrote:
> CL description needs updating too
Done; PTAL.
(Was it just coincidence that your CL fixed the same bug as in the first draft
of this CL?)
*** Submitted as https://code.google.com/p/go/source/detail?r=9f7367db9db0&repo=tools *** go.tools/cmd/vet: improvements to static checking of printf calls. Details: - ...
11 years, 5 months ago
(2013-07-15 22:37:53 UTC)
#13
*** Submitted as
https://code.google.com/p/go/source/detail?r=9f7367db9db0&repo=tools ***
go.tools/cmd/vet: improvements to static checking of printf calls.
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://codereview.appspot.com/10895043
Issue 10895043: code review 10895043: go.tools/cmd/vet: improvements to static checking of pr...
(Closed)
Created 11 years, 5 months ago by adonovan
Modified 11 years, 5 months ago
Reviewers:
Base URL:
Comments: 2