honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/simple/s1016/testdata/src/example.com/CheckSimplerStructConversion/convert_alias.go.golden (about)

     1  package pkg
     2  
     3  type S1 struct {
     4  	A int
     5  }
     6  
     7  type S2 struct {
     8  	A int
     9  }
    10  
    11  type Alias = S2
    12  
    13  // XXX the diagnostics depend on GODEBUG
    14  
    15  func foo() {
    16  	v1 := S1{A: 1}
    17  	v2 := Alias{A: 1}
    18  
    19  	_ = Alias(v1) //@ diag(`should convert v1`)
    20  	_ = S1(v2)    //@ diag(`should convert v2`)
    21  }