aboutsummaryrefslogtreecommitdiff
path: root/vendor/honnef.co/go/tools/functions/terminates.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2018-08-30 13:41:49 -0700
committerGitHub <noreply@github.com>2018-08-30 13:41:49 -0700
commit0f451a722918f39fa07bd9337e4a14ca154b13ae (patch)
tree9868ffed8cb74357a06e63b88c56d71b13b415af /vendor/honnef.co/go/tools/functions/terminates.go
parent1e1b67dae6c3ae3b5acb5ce377b01b286c3e676b (diff)
parent1c9bafdec78b8f238a82314b6d9c566a951486c2 (diff)
Merge pull request #107 from google/mod
Use Go Modules and support Go 1.11 building
Diffstat (limited to 'vendor/honnef.co/go/tools/functions/terminates.go')
-rw-r--r--vendor/honnef.co/go/tools/functions/terminates.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/vendor/honnef.co/go/tools/functions/terminates.go b/vendor/honnef.co/go/tools/functions/terminates.go
deleted file mode 100644
index 65f9e16..0000000
--- a/vendor/honnef.co/go/tools/functions/terminates.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package functions
-
-import "honnef.co/go/tools/ssa"
-
-// terminates reports whether fn is supposed to return, that is if it
-// has at least one theoretic path that returns from the function.
-// Explicit panics do not count as terminating.
-func terminates(fn *ssa.Function) bool {
- if fn.Blocks == nil {
- // assuming that a function terminates is the conservative
- // choice
- return true
- }
-
- for _, block := range fn.Blocks {
- if len(block.Instrs) == 0 {
- continue
- }
- if _, ok := block.Instrs[len(block.Instrs)-1].(*ssa.Return); ok {
- return true
- }
- }
- return false
-}