Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
53653176
Commit
53653176
authored
Mar 29, 2011
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CL 4291070: incorporating rsc's feedback
R=rsc CC=golang-dev
https://golang.org/cl/4313054
parent
a7bb288f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
src/cmd/govet/govet.go
src/cmd/govet/govet.go
+2
-2
src/pkg/go/printer/nodes.go
src/pkg/go/printer/nodes.go
+1
-1
src/pkg/go/printer/printer.go
src/pkg/go/printer/printer.go
+1
-1
No files found.
src/cmd/govet/govet.go
View file @
53653176
...
...
@@ -256,7 +256,7 @@ func (f *File) checkPrintf(call *ast.CallExpr, name string, skip int) {
return
}
if
lit
.
Kind
==
token
.
STRING
{
if
strings
.
Index
(
lit
.
Value
,
"%"
)
<
0
{
if
strings
.
Contains
(
lit
.
Value
,
"%"
)
{
if
len
(
call
.
Args
)
>
skip
+
1
{
f
.
Badf
(
call
.
Pos
(),
"no formatting directive in %s call"
,
name
)
}
...
...
@@ -338,7 +338,7 @@ func (f *File) checkPrint(call *ast.CallExpr, name string, skip int) {
}
arg
:=
args
[
skip
]
if
lit
,
ok
:=
arg
.
(
*
ast
.
BasicLit
);
ok
&&
lit
.
Kind
==
token
.
STRING
{
if
strings
.
Index
(
lit
.
Value
,
"%"
)
>=
0
{
if
strings
.
Contains
(
lit
.
Value
,
"%"
)
{
f
.
Badf
(
call
.
Pos
(),
"possible formatting directive in %s call"
,
name
)
}
}
...
...
src/pkg/go/printer/nodes.go
View file @
53653176
...
...
@@ -515,7 +515,7 @@ func walkBinary(e *ast.BinaryExpr) (has4, has5 bool, maxProblem int) {
}
case
*
ast
.
StarExpr
:
if
e
.
Op
==
token
.
QUO
{
if
e
.
Op
==
token
.
QUO
{
// `*/`
maxProblem
=
5
}
...
...
src/pkg/go/printer/printer.go
View file @
53653176
...
...
@@ -127,7 +127,7 @@ func (p *printer) internalError(msg ...interface{}) {
// escape escapes string s by bracketing it with tabwriter.Escape.
// Escape
s
strings pass through tabwriter unchanged. (Note that
// Escape
d
strings pass through tabwriter unchanged. (Note that
// valid Go programs cannot contain tabwriter.Escape bytes since
// they do not appear in legal UTF-8 sequences).
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment