-
Notifications
You must be signed in to change notification settings - Fork 6
Test with issues #33
base: master
Are you sure you want to change the base?
Test with issues #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package some | ||
|
||
import "log" | ||
|
||
func withIssue() { | ||
log.Printf("bad format: %s", 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Printf format %s has arg 1 of wrong type int |
||
} | ||
|
||
func withAnotherIssue() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
a := 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File is not goimports-ed |
||
if a != 0 { | ||
return | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if block ends with a return statement, so drop this else and outdent its block |
||
panic(a) | ||
} | ||
} | ||
|
||
func testScopeLint() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
funcs := []func(){} | ||
for _, v := range []int{1, 2} { | ||
funcs = append(funcs, func() { | ||
log.Print(v) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the variable on range scope |
||
}) | ||
} | ||
|
||
for _, f := range funcs { | ||
f() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
withIssue
is unused