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

import "fmt"

func _() (int, string, error) {
	x := 1
	y := "hello"
	//@mark(exSt10, "z")
	return newFunction(y, x) //@mark(exEn10, "nil")
	//@extractfunc(exSt10, exEn10)
}

func newFunction(y string, x int) (int, string, error) {
	z := "bye"
	if y == z {
		return x, y, fmt.Errorf("same")
	} else {
		z = "hi"
		return x, z, nil
	}
	return x, z, nil
}