mirror of
https://github.com/golang/go
synced 2024-11-18 22:04:43 -07:00
go/analysis/passes/ctrlflow: add test of modularity
See the Modularity section of the design doc: https://docs.google.com/document/d/1-azPLXaLgTCKeKDNg0HVMq2ovMlD-e7n1ZHzZVzOlJk#heading=h.s7mcpao0dpqu Change-Id: I83e6df01691964703a07a47c222101f3307a0dc6 Reviewed-on: https://go-review.googlesource.com/c/140759 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
8149dec50d
commit
157aeed469
10
go/analysis/passes/ctrlflow/testdata/src/a/a.go
vendored
10
go/analysis/passes/ctrlflow/testdata/src/a/a.go
vendored
@ -8,6 +8,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cond bool
|
var cond bool
|
||||||
@ -97,3 +99,11 @@ func spurious() { // want spurious:"noReturn"
|
|||||||
}
|
}
|
||||||
|
|
||||||
func noBody()
|
func noBody()
|
||||||
|
|
||||||
|
func g() {
|
||||||
|
lib.CanReturn()
|
||||||
|
}
|
||||||
|
|
||||||
|
func h() { // want h:"noReturn"
|
||||||
|
lib.NoReturn()
|
||||||
|
}
|
||||||
|
8
go/analysis/passes/ctrlflow/testdata/src/lib/lib.go
vendored
Normal file
8
go/analysis/passes/ctrlflow/testdata/src/lib/lib.go
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package lib
|
||||||
|
|
||||||
|
func CanReturn() {}
|
||||||
|
|
||||||
|
func NoReturn() {
|
||||||
|
for {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user