diff options
Diffstat (limited to 'gopls/internal/lsp/testdata/extract/extract_function/extract_return_basic.go.golden')
-rw-r--r-- | gopls/internal/lsp/testdata/extract/extract_function/extract_return_basic.go.golden | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/extract/extract_function/extract_return_basic.go.golden b/gopls/internal/lsp/testdata/extract/extract_function/extract_return_basic.go.golden new file mode 100644 index 000000000..6103d1ee9 --- /dev/null +++ b/gopls/internal/lsp/testdata/extract/extract_function/extract_return_basic.go.golden @@ -0,0 +1,21 @@ +-- functionextraction_extract_return_basic_5_2 -- +package extract + +func _() bool { + x := 1 + //@mark(exSt2, "if") + shouldReturn, returnValue := newFunction(x) + if shouldReturn { + return returnValue + } //@mark(exEn2, "}") + return false + //@extractfunc(exSt2, exEn2) +} + +func newFunction(x int) (bool, bool) { + if x == 0 { + return true, true + } + return false, false +} + |