aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/testdata/extract/extract_function/extract_return_init.go.golden
blob: 31d1b2ddf87ccd21408deba941113d785539809e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- functionextraction_extract_return_init_5_2 --
package extract

func _() string {
	x := 1
	//@mark(exSt5, "if")
	shouldReturn, returnValue := newFunction(x)
	if shouldReturn {
		return returnValue
	} //@mark(exEn5, "}")
	x = 2
	return "b"
	//@extractfunc(exSt5, exEn5)
}

func newFunction(x int) (bool, string) {
	if x == 0 {
		x = 3
		return true, "a"
	}
	return false, ""
}