blob: 88c360371dfffa3914e90d491f2c747c4a81a5e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// -*- Mode: Go -*-
package nslcd_proto
type <T>_Enumerator interface {
GetNext() (n <T>, err error)
GenericGetNext() (n interface{}, err error)
}
type <T>_List struct {
dat []<T>
i int
}
func New_<T>_List(ary []<T>) *<T>_List {
return &<T>_List{ary, 0}
}
func (o *<T>_List) GetNext() (n <T>, err error) {
n = o.dat[o.i]
err = nil
o.i++
return
}
func (o *<T>_List) GenericGetNext() (n interface{}, err error) {
return o.GetNext()
}
|