honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/quickfix/qf1008/testdata/src/example.com/CheckExplicitEmbeddedSelector/CheckExplicitEmbeddedSelector-call.go.golden (about) 1 -- Remove embedded field "FunctionCallInner" from selector -- 2 package pkg 3 4 type FunctionCallOuter struct{ FunctionCallInner } 5 type FunctionCallInner struct { 6 F8 func() FunctionCallContinuedOuter 7 } 8 type FunctionCallContinuedOuter struct{ FunctionCallContinuedInner } 9 type FunctionCallContinuedInner struct{ F9 int } 10 11 func fnCall() { 12 var call FunctionCallOuter 13 _ = call.F8().FunctionCallContinuedInner.F9 //@ diag(`could remove embedded field "FunctionCallInner" from selector`), diag(`could remove embedded field "FunctionCallContinuedInner" from selector`), diag(`could simplify selectors`) 14 _ = call.F8().F9 // minimal form 15 } 16 17 -- Remove embedded field "FunctionCallContinuedInner" from selector -- 18 package pkg 19 20 type FunctionCallOuter struct{ FunctionCallInner } 21 type FunctionCallInner struct { 22 F8 func() FunctionCallContinuedOuter 23 } 24 type FunctionCallContinuedOuter struct{ FunctionCallContinuedInner } 25 type FunctionCallContinuedInner struct{ F9 int } 26 27 func fnCall() { 28 var call FunctionCallOuter 29 _ = call.FunctionCallInner.F8().F9 //@ diag(`could remove embedded field "FunctionCallInner" from selector`), diag(`could remove embedded field "FunctionCallContinuedInner" from selector`), diag(`could simplify selectors`) 30 _ = call.F8().F9 // minimal form 31 } 32 33 -- Remove all embedded fields from selector -- 34 package pkg 35 36 type FunctionCallOuter struct{ FunctionCallInner } 37 type FunctionCallInner struct { 38 F8 func() FunctionCallContinuedOuter 39 } 40 type FunctionCallContinuedOuter struct{ FunctionCallContinuedInner } 41 type FunctionCallContinuedInner struct{ F9 int } 42 43 func fnCall() { 44 var call FunctionCallOuter 45 _ = call.F8().F9 //@ diag(`could remove embedded field "FunctionCallInner" from selector`), diag(`could remove embedded field "FunctionCallContinuedInner" from selector`), diag(`could simplify selectors`) 46 _ = call.F8().F9 // minimal form 47 }