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

Delta Between Two Patch Sets: src/cmd/vet/main.go

Issue 7399051: code review 7399051: cmd/vet: silence error from type checker unless verbose... (Closed)
Left Patch Set: diff -r 408b088723fd https://code.google.com/p/go Created 11 years, 1 month ago
Right Patch Set: diff -r ebc229da2df9 https://code.google.com/p/go/ Created 11 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Vet is a simple checker for static errors in Go source code. 5 // Vet is a simple checker for static errors in Go source code.
6 // See doc.go for more information. 6 // See doc.go for more information.
7 package main 7 package main
8 8
9 import ( 9 import (
10 "bytes" 10 "bytes"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 pkg, err := build.Default.ImportDir(directory, 0) 152 pkg, err := build.Default.ImportDir(directory, 0)
153 if err != nil { 153 if err != nil {
154 // If it's just that there are no go source files, that's fine. 154 // If it's just that there are no go source files, that's fine.
155 if _, nogo := err.(*build.NoGoError); nogo { 155 if _, nogo := err.(*build.NoGoError); nogo {
156 return 156 return
157 } 157 }
158 // Non-fatal: we are doing a recursive walk and there may be oth er directories. 158 // Non-fatal: we are doing a recursive walk and there may be oth er directories.
159 warnf("cannot process directory %s: %s", directory, err) 159 warnf("cannot process directory %s: %s", directory, err)
160 return 160 return
161 } 161 }
162 » names := append(pkg.GoFiles, pkg.CgoFiles...) 162 » var names []string
rsc 2013/02/25 22:16:59 Just for my neuroses, please do var names []strin
163 » names = append(names, pkg.CgoFiles...)
163 names = append(names, pkg.TestGoFiles...) // These are also in the "foo" package. 164 names = append(names, pkg.TestGoFiles...) // These are also in the "foo" package.
164 prefixDirectory(directory, names) 165 prefixDirectory(directory, names)
165 doPackage(names) 166 doPackage(names)
166 // Is there also a "foo_test" package? If so, do that one as well. 167 // Is there also a "foo_test" package? If so, do that one as well.
167 if len(pkg.XTestGoFiles) > 0 { 168 if len(pkg.XTestGoFiles) > 0 {
168 names = pkg.XTestGoFiles 169 names = pkg.XTestGoFiles
169 prefixDirectory(directory, names) 170 prefixDirectory(directory, names)
170 doPackage(names) 171 doPackage(names)
171 } 172 }
172 } 173 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 func (f *File) walkRangeStmt(n *ast.RangeStmt) { 387 func (f *File) walkRangeStmt(n *ast.RangeStmt) {
387 checkRangeLoop(f, n) 388 checkRangeLoop(f, n)
388 } 389 }
389 390
390 // goFmt returns a string representation of the expression 391 // goFmt returns a string representation of the expression
391 func (f *File) gofmt(x ast.Expr) string { 392 func (f *File) gofmt(x ast.Expr) string {
392 f.b.Reset() 393 f.b.Reset()
393 printer.Fprint(&f.b, f.fset, x) 394 printer.Fprint(&f.b, f.fset, x)
394 return f.b.String() 395 return f.b.String()
395 } 396 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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