diff options
Diffstat (limited to 'gopls/internal/lsp/testdata/extract/extract_function/extract_return_complex_nonnested.go.golden')
-rw-r--r-- | gopls/internal/lsp/testdata/extract/extract_function/extract_return_complex_nonnested.go.golden | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/extract/extract_function/extract_return_complex_nonnested.go.golden b/gopls/internal/lsp/testdata/extract/extract_function/extract_return_complex_nonnested.go.golden new file mode 100644 index 000000000..de54b1534 --- /dev/null +++ b/gopls/internal/lsp/testdata/extract/extract_function/extract_return_complex_nonnested.go.golden @@ -0,0 +1,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 +} + |