зеркало из https://github.com/golang/tools.git
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:
Родитель
8149dec50d
Коммит
157aeed469
|
@ -8,6 +8,8 @@ import (
|
|||
"runtime"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"lib"
|
||||
)
|
||||
|
||||
var cond bool
|
||||
|
@ -97,3 +99,11 @@ func spurious() { // want spurious:"noReturn"
|
|||
}
|
||||
|
||||
func noBody()
|
||||
|
||||
func g() {
|
||||
lib.CanReturn()
|
||||
}
|
||||
|
||||
func h() { // want h:"noReturn"
|
||||
lib.NoReturn()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package lib
|
||||
|
||||
func CanReturn() {}
|
||||
|
||||
func NoReturn() {
|
||||
for {
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче