internal/lsp: break up fillstruct testdata to make it more manageable
Broke a.go into a few files (no real logic to it). These tests could be
categorized better, but it's a good start just to break up that huge
golden file.
Change-Id: I2c173f11ea2766e9232e3ec838c16f535cbee788
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253279
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go b/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go
index 1fc1c55..5c6df6c 100644
--- a/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go
@@ -1,13 +1,6 @@
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
package fillstruct
import (
- "go/ast"
- "go/token"
-
"golang.org/x/tools/internal/lsp/fillstruct/data"
)
@@ -32,103 +25,3 @@
var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go.golden b/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go.golden
index 6dade08..5d6dbce 100644
--- a/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go.golden
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a.go.golden
@@ -1,1853 +1,7 @@
--- suggestedfix_a_100_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
+-- suggestedfix_a_11_21 --
package fillstruct
import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{
- ValuePos: 0,
- Kind: 0,
- Value: "",
-}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_100_30 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{
- b: new(bool),
- s: new(string),
- i: new(int),
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_102_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{
- ValuePos: 0,
- Kind: 0,
- Value: "",
-}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_103_3 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {
- ValuePos: 0,
- Kind: 0,
- Value: "",
- }, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_106_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{
- ValuePos: 0,
- Kind: 0,
- Value: "",
-}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_120_18 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{
- X: x,
- } //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_122_18 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{
- X: x,
- } //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_123_18 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{
- str: s,
- } //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_125_18 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{
- str: s,
- } //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_126_20 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- var _ = multiFill{
- num: n,
- strin: s,
- arr: []int{},
- } //@suggestedfix("}", "refactor.rewrite")
-
- var compLit *ast.CompositeLit
- var _ = assignStruct{}
-
-}
-
--- suggestedfix_a_130_20 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{
- num: n,
- strin: s,
- arr: []int{},
- } //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_132_20 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{
- num: n,
- strin: s,
- arr: []int{},
- } //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_133_23 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{
- n: node,
- } //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_135_23 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{
- n: node,
- } //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_18_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
"golang.org/x/tools/internal/lsp/fillstruct/data"
)
@@ -1875,281 +29,27 @@
var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_20_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
+-- suggestedfix_a_18_22 --
package fillstruct
import (
- "go/ast"
- "go/token"
-
"golang.org/x/tools/internal/lsp/fillstruct/data"
)
-var foop int
-
type basicStruct struct {
foo int
}
-var _ = basicStruct{
- foo: 0,
-} //@suggestedfix("}", "refactor.rewrite")
+var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
type twoArgStruct struct {
foo int
bar string
}
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_22_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{
- foo: 0,
-} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
var _ = twoArgStruct{
- bar: "bar",
+ foo: 0,
+ bar: "",
} //@suggestedfix("}", "refactor.rewrite")
type nestedStruct struct {
@@ -2161,577 +61,10 @@
var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-- suggestedfix_a_25_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
package fillstruct
import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{
- foo: 0,
- bar: "",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_27_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{
- foo: 0,
- bar: "",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_29_1 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- foo: 0,
- bar: "",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_29_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{
- foo: 0,
- bar: "",
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_32_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
"golang.org/x/tools/internal/lsp/fillstruct/data"
)
@@ -2760,226 +93,10 @@
var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_33_1 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
+-- suggestedfix_a_27_16 --
package fillstruct
import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- foo: 0,
- bar: "",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_34_16 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
"golang.org/x/tools/internal/lsp/fillstruct/data"
)
@@ -3007,4758 +124,3 @@
ExportedInt: 0,
} //@suggestedfix("}", "refactor.rewrite")
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_34_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{
- bar: "",
- basic: basicStruct{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_36_16 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{
- ExportedInt: 0,
-} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_36_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{
- bar: "",
- basic: basicStruct{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_38_16 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{
- ExportedInt: 0,
-} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_40_22 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{
- bar: "",
- basic: basicStruct{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_42_16 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{
- ExportedInt: 0,
-} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_44_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{
- m: map[string]int{},
- s: []int{},
- c: make(chan int),
- c1: make(<-chan int),
- a: [2]string{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_46_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{
- m: map[string]int{},
- s: []int{},
- c: make(chan int),
- c1: make(<-chan int),
- a: [2]string{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_48_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{
- m: map[string]int{},
- s: []int{},
- c: make(chan int),
- c1: make(<-chan int),
- a: [2]string{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_50_19 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{
- fn: func(i int) int {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_52_19 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{
- fn: func(i int) int {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_52_21 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{
- m: map[string]int{},
- s: []int{},
- c: make(chan int),
- c1: make(<-chan int),
- a: [2]string{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_54_19 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{
- fn: func(i int) int {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_56_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{
- fn: func(i int, s string) (string, int) {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_58_19 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{
- fn: func(i int) int {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_58_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{
- fn: func(i int, s string) (string, int) {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_60_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{
- fn: func(i int, s string) (string, int) {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_62_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{
- fn: func() {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_64_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{
- fn: func() {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_64_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{
- fn: func(i int, s string) (string, int) {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_66_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{
- fn: func() {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_70_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{
- fn: func() {
- },
-} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_73_13 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{
- X: &Foo{},
- Y: &Foo{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_75_13 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{
- X: &Foo{},
- Y: &Foo{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_77_13 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{
- X: &Foo{},
- Y: &Foo{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_81_13 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{
- X: &Foo{},
- Y: &Foo{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_84_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{
- m: map[*ast.CompositeLit]ast.Field{},
- s: []ast.BadExpr{},
- a: [3]token.Token{},
- c: make(chan ast.EmptyStmt),
- fn: func(ast_decl ast.DeclStmt) ast.Ellipsis {
- },
- st: ast.CompositeLit{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_86_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{
- m: map[*ast.CompositeLit]ast.Field{},
- s: []ast.BadExpr{},
- a: [3]token.Token{},
- c: make(chan ast.EmptyStmt),
- fn: func(ast_decl ast.DeclStmt) ast.Ellipsis {
- },
- st: ast.CompositeLit{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_88_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{
- m: map[*ast.CompositeLit]ast.Field{},
- s: []ast.BadExpr{},
- a: [3]token.Token{},
- c: make(chan ast.EmptyStmt),
- fn: func(ast_decl ast.DeclStmt) ast.Ellipsis {
- },
- st: ast.CompositeLit{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_92_24 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type emptyStruct struct{}
-
-var _ = emptyStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{
- m: map[*ast.CompositeLit]ast.Field{},
- s: []ast.BadExpr{},
- a: [3]token.Token{},
- c: make(chan ast.EmptyStmt),
- fn: func(ast_decl ast.DeclStmt) ast.Ellipsis {
- },
- st: ast.CompositeLit{},
-} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_92_30 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{
- b: new(bool),
- s: new(string),
- i: new(int),
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_94_30 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{
- b: new(bool),
- s: new(string),
- i: new(int),
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_95_3 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {
- ValuePos: 0,
- Kind: 0,
- Value: "",
- }, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_96_30 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{
- b: new(bool),
- s: new(string),
- i: new(int),
-} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
--- suggestedfix_a_97_3 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-var foop int
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {
- ValuePos: 0,
- Kind: 0,
- Value: "",
- }, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_98_25 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {}, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{
- ValuePos: 0,
- Kind: 0,
- Value: "",
-}} //@suggestedfix("}", "refactor.rewrite")
-
-type iStruct struct {
- X int
-}
-
-type sStruct struct {
- str string
-}
-
-type multiFill struct {
- num int
- strin string
- arr []int
-}
-
-type assignStruct struct {
- n ast.Node
-}
-
-func fill() {
- var x int
- var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var s string
- var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
-
- var n int
- _ = []int{}
- if true {
- arr := []int{1, 2}
- }
- var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
-
- var node *ast.CompositeLit
- var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
-}
-
--- suggestedfix_a_99_3 --
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fillstruct
-
-import (
- "go/ast"
- "go/token"
-
- "golang.org/x/tools/internal/lsp/fillstruct/data"
-)
-
-type basicStruct struct {
- foo int
-}
-
-var _ = basicStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type twoArgStruct struct {
- foo int
- bar string
-}
-
-var _ = twoArgStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = twoArgStruct{
- bar: "bar",
-} //@suggestedfix("}", "refactor.rewrite")
-
-type nestedStruct struct {
- bar string
- basic basicStruct
-}
-
-var _ = nestedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = data.B{} //@suggestedfix("}", "refactor.rewrite")
-
-type typedStruct struct {
- m map[string]int
- s []int
- c chan int
- c1 <-chan int
- a [2]string
-}
-
-var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStruct struct {
- fn func(i int) int
-}
-
-var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructCompex struct {
- fn func(i int, s string) (string, int)
-}
-
-var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
-
-type funStructEmpty struct {
- fn func()
-}
-
-var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
-
-type Foo struct {
- A int
-}
-
-type Bar struct {
- X *Foo
- Y *Foo
-}
-
-var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
-
-type importedStruct struct {
- m map[*ast.CompositeLit]ast.Field
- s []ast.BadExpr
- a [3]token.Token
- c chan ast.EmptyStmt
- fn func(ast_decl ast.DeclStmt) ast.Ellipsis
- st ast.CompositeLit
-}
-
-var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-type pointerBuiltinStruct struct {
- b *bool
- s *string
- i *int
-}
-
-var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
-
-var _ = []ast.BasicLit{
- {
- ValuePos: 0,
- Kind: 0,
- Value: "",
- }, //@suggestedfix("}", "refactor.rewrite")
-}
-
-var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
-
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go b/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go
new file mode 100644
index 0000000..8e12a6b
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go
@@ -0,0 +1,29 @@
+package fillstruct
+
+type typedStruct struct {
+ m map[string]int
+ s []int
+ c chan int
+ c1 <-chan int
+ a [2]string
+}
+
+var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStruct struct {
+ fn func(i int) int
+}
+
+var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructCompex struct {
+ fn func(i int, s string) (string, int)
+}
+
+var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructEmpty struct {
+ fn func()
+}
+
+var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go.golden b/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go.golden
new file mode 100644
index 0000000..78a6ee2
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a2.go.golden
@@ -0,0 +1,139 @@
+-- suggestedfix_a2_11_21 --
+package fillstruct
+
+type typedStruct struct {
+ m map[string]int
+ s []int
+ c chan int
+ c1 <-chan int
+ a [2]string
+}
+
+var _ = typedStruct{
+ m: map[string]int{},
+ s: []int{},
+ c: make(chan int),
+ c1: make(<-chan int),
+ a: [2]string{},
+} //@suggestedfix("}", "refactor.rewrite")
+
+type funStruct struct {
+ fn func(i int) int
+}
+
+var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructCompex struct {
+ fn func(i int, s string) (string, int)
+}
+
+var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructEmpty struct {
+ fn func()
+}
+
+var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a2_17_19 --
+package fillstruct
+
+type typedStruct struct {
+ m map[string]int
+ s []int
+ c chan int
+ c1 <-chan int
+ a [2]string
+}
+
+var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStruct struct {
+ fn func(i int) int
+}
+
+var _ = funStruct{
+ fn: func(i int) int {
+ },
+} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructCompex struct {
+ fn func(i int, s string) (string, int)
+}
+
+var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructEmpty struct {
+ fn func()
+}
+
+var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a2_23_25 --
+package fillstruct
+
+type typedStruct struct {
+ m map[string]int
+ s []int
+ c chan int
+ c1 <-chan int
+ a [2]string
+}
+
+var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStruct struct {
+ fn func(i int) int
+}
+
+var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructCompex struct {
+ fn func(i int, s string) (string, int)
+}
+
+var _ = funStructCompex{
+ fn: func(i int, s string) (string, int) {
+ },
+} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructEmpty struct {
+ fn func()
+}
+
+var _ = funStructEmpty{} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a2_29_24 --
+package fillstruct
+
+type typedStruct struct {
+ m map[string]int
+ s []int
+ c chan int
+ c1 <-chan int
+ a [2]string
+}
+
+var _ = typedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStruct struct {
+ fn func(i int) int
+}
+
+var _ = funStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructCompex struct {
+ fn func(i int, s string) (string, int)
+}
+
+var _ = funStructCompex{} //@suggestedfix("}", "refactor.rewrite")
+
+type funStructEmpty struct {
+ fn func()
+}
+
+var _ = funStructEmpty{
+ fn: func() {
+ },
+} //@suggestedfix("}", "refactor.rewrite")
+
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go b/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go
new file mode 100644
index 0000000..730db30
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go
@@ -0,0 +1,42 @@
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {}, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go.golden b/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go.golden
new file mode 100644
index 0000000..1d86729
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a3.go.golden
@@ -0,0 +1,243 @@
+-- suggestedfix_a3_17_13 --
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{
+ X: &Foo{},
+ Y: &Foo{},
+} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {}, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a3_28_24 --
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{
+ m: map[*ast.CompositeLit]ast.Field{},
+ s: []ast.BadExpr{},
+ a: [3]token.Token{},
+ c: make(chan ast.EmptyStmt),
+ fn: func(ast_decl ast.DeclStmt) ast.Ellipsis {
+ },
+ st: ast.CompositeLit{},
+} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {}, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a3_36_30 --
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{
+ b: new(bool),
+ s: new(string),
+ i: new(int),
+} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {}, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a3_39_3 --
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {
+ ValuePos: 0,
+ Kind: 0,
+ Value: "",
+ }, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{}} //@suggestedfix("}", "refactor.rewrite")
+
+-- suggestedfix_a3_42_25 --
+package fillstruct
+
+import (
+ "go/ast"
+ "go/token"
+)
+
+type Foo struct {
+ A int
+}
+
+type Bar struct {
+ X *Foo
+ Y *Foo
+}
+
+var _ = Bar{} //@suggestedfix("}", "refactor.rewrite")
+
+type importedStruct struct {
+ m map[*ast.CompositeLit]ast.Field
+ s []ast.BadExpr
+ a [3]token.Token
+ c chan ast.EmptyStmt
+ fn func(ast_decl ast.DeclStmt) ast.Ellipsis
+ st ast.CompositeLit
+}
+
+var _ = importedStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+type pointerBuiltinStruct struct {
+ b *bool
+ s *string
+ i *int
+}
+
+var _ = pointerBuiltinStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+var _ = []ast.BasicLit{
+ {}, //@suggestedfix("}", "refactor.rewrite")
+}
+
+var _ = []ast.BasicLit{{
+ ValuePos: 0,
+ Kind: 0,
+ Value: "",
+}} //@suggestedfix("}", "refactor.rewrite")
+
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go b/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go
new file mode 100644
index 0000000..7833d33
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go
@@ -0,0 +1,39 @@
+package fillstruct
+
+import "go/ast"
+
+type iStruct struct {
+ X int
+}
+
+type sStruct struct {
+ str string
+}
+
+type multiFill struct {
+ num int
+ strin string
+ arr []int
+}
+
+type assignStruct struct {
+ n ast.Node
+}
+
+func fill() {
+ var x int
+ var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var s string
+ var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var n int
+ _ = []int{}
+ if true {
+ arr := []int{1, 2}
+ }
+ var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
+
+ var node *ast.CompositeLit
+ var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
+}
diff --git a/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go.golden b/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go.golden
new file mode 100644
index 0000000..109c6b5
--- /dev/null
+++ b/internal/lsp/testdata/lsp/primarymod/fillstruct/a4.go.golden
@@ -0,0 +1,174 @@
+-- suggestedfix_a4_25_18 --
+package fillstruct
+
+import "go/ast"
+
+type iStruct struct {
+ X int
+}
+
+type sStruct struct {
+ str string
+}
+
+type multiFill struct {
+ num int
+ strin string
+ arr []int
+}
+
+type assignStruct struct {
+ n ast.Node
+}
+
+func fill() {
+ var x int
+ var _ = iStruct{
+ X: x,
+ } //@suggestedfix("}", "refactor.rewrite")
+
+ var s string
+ var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var n int
+ _ = []int{}
+ if true {
+ arr := []int{1, 2}
+ }
+ var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
+
+ var node *ast.CompositeLit
+ var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
+}
+
+-- suggestedfix_a4_28_18 --
+package fillstruct
+
+import "go/ast"
+
+type iStruct struct {
+ X int
+}
+
+type sStruct struct {
+ str string
+}
+
+type multiFill struct {
+ num int
+ strin string
+ arr []int
+}
+
+type assignStruct struct {
+ n ast.Node
+}
+
+func fill() {
+ var x int
+ var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var s string
+ var _ = sStruct{
+ str: s,
+ } //@suggestedfix("}", "refactor.rewrite")
+
+ var n int
+ _ = []int{}
+ if true {
+ arr := []int{1, 2}
+ }
+ var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
+
+ var node *ast.CompositeLit
+ var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
+}
+
+-- suggestedfix_a4_35_20 --
+package fillstruct
+
+import "go/ast"
+
+type iStruct struct {
+ X int
+}
+
+type sStruct struct {
+ str string
+}
+
+type multiFill struct {
+ num int
+ strin string
+ arr []int
+}
+
+type assignStruct struct {
+ n ast.Node
+}
+
+func fill() {
+ var x int
+ var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var s string
+ var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var n int
+ _ = []int{}
+ if true {
+ arr := []int{1, 2}
+ }
+ var _ = multiFill{
+ num: n,
+ strin: s,
+ arr: []int{},
+ } //@suggestedfix("}", "refactor.rewrite")
+
+ var node *ast.CompositeLit
+ var _ = assignStruct{} //@suggestedfix("}", "refactor.rewrite")
+}
+
+-- suggestedfix_a4_38_23 --
+package fillstruct
+
+import "go/ast"
+
+type iStruct struct {
+ X int
+}
+
+type sStruct struct {
+ str string
+}
+
+type multiFill struct {
+ num int
+ strin string
+ arr []int
+}
+
+type assignStruct struct {
+ n ast.Node
+}
+
+func fill() {
+ var x int
+ var _ = iStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var s string
+ var _ = sStruct{} //@suggestedfix("}", "refactor.rewrite")
+
+ var n int
+ _ = []int{}
+ if true {
+ arr := []int{1, 2}
+ }
+ var _ = multiFill{} //@suggestedfix("}", "refactor.rewrite")
+
+ var node *ast.CompositeLit
+ var _ = assignStruct{
+ n: node,
+ } //@suggestedfix("}", "refactor.rewrite")
+}
+