github.com/goplus/gop@v1.2.6/printer/_testdata/36-Auto-Property/autoprop.gop (about)

     1  import (
     2  	"gop/ast/goptest"
     3  )
     4  
     5  script := `
     6      import (
     7          gio "io"
     8      )
     9  
    10      func New() (*Bar, error) {
    11          return nil, gio.EOF
    12      }
    13  
    14      bar, err := New()
    15      if err != nil {
    16          log.Println(err)
    17      }
    18  `
    19  
    20  doc := goptest.New(script)!
    21  
    22  println(doc.any.funcDecl.name)
    23  println(doc.any.importSpec.name)