1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
-- functionextraction_extract_return_complex_8_2 --
package extract
import "fmt"
func _() (int, string, error) {
x := 1
y := "hello"
//@mark(exSt3, "z")
z, shouldReturn, returnValue, returnValue1, returnValue2 := newFunction(y, x)
if shouldReturn {
return returnValue, returnValue1, returnValue2
} //@mark(exEn3, "}")
return x, z, nil
//@extractfunc(exSt3, exEn3)
}
func newFunction(y string, x int) (string, bool, int, string, error) {
z := "bye"
if y == z {
return "", true, x, y, fmt.Errorf("same")
} else {
z = "hi"
return "", true, x, z, nil
}
return z, false, 0, "", nil
}
|