github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/unused/testdata/src/example.com/unsafe-recursive/conversion.go (about)

     1  package pkg
     2  
     3  // https://staticcheck.dev/issues/1249
     4  
     5  import "unsafe"
     6  
     7  type t1 struct { //@ used("t1", true)
     8  	f1  int      //@ used("f1", true)
     9  	f2  t2       //@ used("f2", true)
    10  	f3  *t3      //@ used("f3", true)
    11  	t4           //@ used("t4", true)
    12  	*t5          //@ used("t5", true)
    13  	f6  [5]t6    //@ used("f6", true)
    14  	f7  [5][5]t7 //@ used("f7", true)
    15  	f8  nt1      //@ used("f8", true)
    16  	f9  nt2      //@ used("f9", true)
    17  }
    18  
    19  type nt1 *t8   //@ used("nt1", true)
    20  type nt2 [4]t9 //@ used("nt2", true)
    21  
    22  type t2 struct{ f int } //@ used("t2", true), used("f", true)
    23  type t3 struct{ f int } //@ used("t3", true), used("f", false)
    24  type t4 struct{ f int } //@ used("t4", true), used("f", true)
    25  type t5 struct{ f int } //@ used("t5", true), used("f", false)
    26  type t6 struct{ f int } //@ used("t6", true), used("f", true)
    27  type t7 struct{ f int } //@ used("t7", true), used("f", true)
    28  type t8 struct{ f int } //@ used("t8", true), used("f", false)
    29  type t9 struct{ f int } //@ used("t9", true), used("f", true)
    30  
    31  func Foo(x t1) { //@ used("Foo", true), used("x", true)
    32  	_ = unsafe.Pointer(&x)
    33  }