summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/3rf/mongo-lint/testdata/else-multi.go
blob: 98f39a3eb5ba9b8513b088d795cb5abe41ac8604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test of return+else warning; should not trigger on multi-branch if/else.
// OK

// Package pkg ...
package pkg

import "log"

func f(x int) bool {
	if x == 0 {
		log.Print("x is zero")
	} else if x > 0 {
		return true
	} else {
		log.Printf("non-positive x: %d", x)
	}
	return false
}