github.com/goplus/igop@v0.25.0/testdata/info/info.go (about)

     1  package info
     2  
     3  type Info interface {
     4  	Mode() int
     5  	SetMode(n int)
     6  	Count(a ...int) int
     7  }
     8  
     9  type MyInfo struct {
    10  	mode int
    11  }
    12  
    13  func (i MyInfo) Mode() int {
    14  	return i.mode
    15  }
    16  
    17  func (i *MyInfo) SetMode(mode int) {
    18  	i.mode = mode
    19  }
    20  
    21  func (i *MyInfo) Count(a ...int) int {
    22  	return len(a)
    23  }
    24  
    25  func NewInfo(mode int) *MyInfo {
    26  	return &MyInfo{mode}
    27  }