github.com/yunabe/lgo@v0.0.0-20190709125917-42c42d410fdf/converter/testdata/simple.golden (about)

     1  package lgo_exec
     2  
     3  import (
     4  	"fmt"
     5  )
     6  import renamedio "io"
     7  func fact(n int64) int64 {
     8  	if n > 0 {
     9  		return n * fact(n-1)
    10  	}
    11  	return 1
    12  }
    13  type myStruct struct {
    14  	value int
    15  }
    16  func (m *myStruct) hello(name string) string {
    17  	return fmt.Sprintf("Hello %s!", name)
    18  }
    19  func returnInterface() interface {
    20  	method(int) float32
    21  } {
    22  	panic("not implemented")
    23  }
    24  func lgo_init() {
    25  
    26  	sp = &myStruct{}
    27  	msg0 = sv.hello("World0")
    28  	msg1 = sp.hello("World1")
    29  
    30  	inter = returnInterface()
    31  
    32  	f = fact(10)
    33  	pi, pi2 = 3.14, 6.28
    34  }
    35  const (
    36  	ca = "hello"
    37  	cb = "piyo"
    38  )
    39  var (
    40  	sv    myStruct
    41  	sp    *myStruct
    42  	msg0  string
    43  	msg1  string
    44  	inter interface {
    45  		method(int) float32
    46  	}
    47  	f int64
    48  
    49  	pi  float32
    50  	pi2 float32
    51  
    52  	reader renamedio.Reader
    53  )