github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/quickfix/qf1008/testdata/src/example.com/CheckExplicitEmbeddedSelector/CheckExplicitEmbeddedSelector-multi.go.golden (about) 1 -- Remove embedded field "BasicInner" from selector -- 2 package pkg 3 4 type MultiLevel struct{ BasicOuter } 5 6 func fnMulti() { 7 var multi MultiLevel 8 _ = multi.BasicOuter.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`), diag(`could remove embedded field "BasicInner" from selector`), diag(`could simplify selectors`) 9 _ = multi.BasicOuter.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`) 10 _ = multi.F1 //@ diag(`could remove embedded field "BasicInner" from selector`) 11 _ = multi.F1 // minimal form 12 } 13 14 -- Remove embedded field "BasicOuter" from selector -- 15 package pkg 16 17 type MultiLevel struct{ BasicOuter } 18 19 func fnMulti() { 20 var multi MultiLevel 21 _ = multi.BasicInner.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`), diag(`could remove embedded field "BasicInner" from selector`), diag(`could simplify selectors`) 22 _ = multi.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`) 23 _ = multi.BasicInner.F1 //@ diag(`could remove embedded field "BasicInner" from selector`) 24 _ = multi.F1 // minimal form 25 } 26 27 -- Remove all embedded fields from selector -- 28 package pkg 29 30 type MultiLevel struct{ BasicOuter } 31 32 func fnMulti() { 33 var multi MultiLevel 34 _ = multi.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`), diag(`could remove embedded field "BasicInner" from selector`), diag(`could simplify selectors`) 35 _ = multi.BasicOuter.F1 //@ diag(`could remove embedded field "BasicOuter" from selector`) 36 _ = multi.BasicInner.F1 //@ diag(`could remove embedded field "BasicInner" from selector`) 37 _ = multi.F1 // minimal form 38 }