-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from gostaticanalysis/release-v0.4.0
Release v0.4.0
- Loading branch information
Showing
4 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# analysisutil | ||
|
||
[![godoc.org][godoc-badge]][godoc] | ||
[![PkgGoDev](https://pkg.go.dev/badge/github.com/gostaticanalysis/analysisutil)](https://pkg.go.dev/github.com/gostaticanalysis/analysisutil) | ||
|
||
Utilities for x/tools/go/analysis package. | ||
|
||
<!-- links --> | ||
[godoc]: https://godoc.org/github.com/gostaticanalysis/analysisutil | ||
[godoc-badge]: https://img.shields.io/badge/godoc-reference-4F73B3.svg?style=flat-square&label=%20godoc.org | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package used | ||
|
||
var ( | ||
N int | ||
V interface{} | ||
) | ||
|
||
func f1(v interface{}) { // want "used" | ||
println(v) | ||
} | ||
|
||
func f2(v interface{}) {} // unsed | ||
|
||
func f3(v interface{}) { // unsed | ||
{ | ||
v := 100 | ||
println(v) | ||
} | ||
} | ||
|
||
func f4(v interface{}) { // want "used" | ||
V = v | ||
} | ||
|
||
func f5(v interface{}) { // want "used" | ||
if N == 0 { | ||
return | ||
} | ||
V = v | ||
} | ||
|
||
func f6(v interface{}) { // want "used" | ||
func() { | ||
println(v) | ||
}() | ||
} | ||
|
||
func f7(v interface{}) { // want "used" | ||
go func() { | ||
println(v) | ||
}() | ||
} | ||
|
||
func f8(v interface{}) { // want "used" | ||
defer func() { | ||
println(v) | ||
}() | ||
} |