Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(255)

Issue 13102043: code review 13102043: go.tools/cmd/vet: detect useless function comparisons (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 3 months ago by adg
Modified:
4 years, 3 months ago
Reviewers:
r, dsymonds
CC:
golang-dev, dsymonds, r
Visibility:
Public.

Description

go.tools/cmd/vet: detect useless function comparisons Also fix bug in types.go discovered by this check. Fixes issue 5347.

Patch Set 1 #

Patch Set 2 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Patch Set 3 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Total comments: 6

Patch Set 4 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Total comments: 5

Patch Set 5 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Patch Set 6 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Total comments: 1

Patch Set 7 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Total comments: 1

Patch Set 8 : diff -r a7b751825c27 https://code.google.com/p/go.tools #

Total comments: 6

Patch Set 9 : diff -r a7b16621542f https://code.google.com/p/go.tools #

Patch Set 10 : diff -r d47ca4bb6e48 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -1 line) Patch
M cmd/vet/main.go View 1 2 3 4 3 chunks +7 lines, -0 lines 0 comments Download
A cmd/vet/nilfunc.go View 1 2 3 4 5 6 7 8 1 chunk +63 lines, -0 lines 0 comments Download
A cmd/vet/testdata/nilfunc.go View 1 2 3 4 5 6 7 8 1 chunk +37 lines, -0 lines 0 comments Download
M cmd/vet/types.go View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 14
adg
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go.tools
4 years, 3 months ago (2013-08-20 04:23:31 UTC) #1
dsymonds
https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go#newcode47 cmd/vet/nilfunc.go:47: f.Badf(expr.Pos(), "function uselessly compared to nil") I think this ...
4 years, 3 months ago (2013-08-20 04:30:56 UTC) #2
adg
https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go#newcode47 cmd/vet/nilfunc.go:47: f.Badf(expr.Pos(), "function uselessly compared to nil") Please suggest better ...
4 years, 3 months ago (2013-08-20 04:44:23 UTC) #3
dsymonds
https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go#newcode47 cmd/vet/nilfunc.go:47: f.Badf(expr.Pos(), "function uselessly compared to nil") On 2013/08/20 04:44:23, ...
4 years, 3 months ago (2013-08-20 04:45:53 UTC) #4
r
https://codereview.appspot.com/13102043/diff/12001/cmd/vet/main.go File cmd/vet/main.go (right): https://codereview.appspot.com/13102043/diff/12001/cmd/vet/main.go#newcode47 cmd/vet/main.go:47: "unreachable": flag.Bool("unreachable", false, "check for unreachable code"), need a ...
4 years, 3 months ago (2013-08-20 04:46:21 UTC) #5
r
https://codereview.appspot.com/13102043/diff/12001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/12001/cmd/vet/nilfunc.go#newcode5 cmd/vet/nilfunc.go:5: package main need a comment. https://codereview.appspot.com/13102043/diff/12001/cmd/vet/nilfunc.go#newcode29 cmd/vet/nilfunc.go:29: } i ...
4 years, 3 months ago (2013-08-20 04:49:00 UTC) #6
adg
https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/6001/cmd/vet/nilfunc.go#newcode47 cmd/vet/nilfunc.go:47: f.Badf(expr.Pos(), "function uselessly compared to nil") On 2013/08/20 04:45:53, ...
4 years, 3 months ago (2013-08-20 04:56:55 UTC) #7
dsymonds
LGTM https://codereview.appspot.com/13102043/diff/21001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/21001/cmd/vet/nilfunc.go#newcode55 cmd/vet/nilfunc.go:55: val := "true" you could actually inline all ...
4 years, 3 months ago (2013-08-20 05:03:30 UTC) #8
adg
Hello golang-dev@googlegroups.com, dsymonds@golang.org, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
4 years, 3 months ago (2013-08-20 05:09:32 UTC) #9
dsymonds
LGTM https://codereview.appspot.com/13102043/diff/8004/cmd/vet/types.go File cmd/vet/types.go (right): https://codereview.appspot.com/13102043/diff/8004/cmd/vet/types.go#newcode269 cmd/vet/types.go:269: if sig.Recv() == nil { good spot
4 years, 3 months ago (2013-08-20 05:20:07 UTC) #10
r
https://codereview.appspot.com/13102043/diff/31001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/31001/cmd/vet/nilfunc.go#newcode6 cmd/vet/nilfunc.go:6: This file contains the code to check for useless ...
4 years, 3 months ago (2013-08-20 05:25:25 UTC) #11
adg
https://codereview.appspot.com/13102043/diff/31001/cmd/vet/nilfunc.go File cmd/vet/nilfunc.go (right): https://codereview.appspot.com/13102043/diff/31001/cmd/vet/nilfunc.go#newcode6 cmd/vet/nilfunc.go:6: This file contains the code to check for useless ...
4 years, 3 months ago (2013-08-20 05:33:53 UTC) #12
r
LGTM
4 years, 3 months ago (2013-08-20 05:49:51 UTC) #13
adg
4 years, 3 months ago (2013-08-20 06:11:08 UTC) #14
*** Submitted as
https://code.google.com/p/go/source/detail?r=40ea8f657df4&repo=tools ***

go.tools/cmd/vet: detect useless function comparisons

Also fix bug in types.go discovered by this check.

Fixes issue 5347.

R=golang-dev, dsymonds, r
CC=golang-dev
https://codereview.appspot.com/13102043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld c59f3c4