summaryrefslogtreecommitdiff
path: root/src/nslcd_proto/enumerator@T.got
diff options
context:
space:
mode:
Diffstat (limited to 'src/nslcd_proto/enumerator@T.got')
-rw-r--r--src/nslcd_proto/enumerator@T.got19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/nslcd_proto/enumerator@T.got b/src/nslcd_proto/enumerator@T.got
index 88c3603..06d6171 100644
--- a/src/nslcd_proto/enumerator@T.got
+++ b/src/nslcd_proto/enumerator@T.got
@@ -2,7 +2,7 @@
package nslcd_proto
type <T>_Enumerator interface {
- GetNext() (n <T>, err error)
+ GetNext() (n *<T>, err error)
GenericGetNext() (n interface{}, err error)
}
@@ -15,12 +15,23 @@ 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]
+func (o *<T>_List) GetNext() (n *<T>, err error) {
+ if o.i < len(o.dat) {
+ n = &o.dat[o.i]
+ o.i++
+ }
err = nil
- o.i++
return
}
func (o *<T>_List) GenericGetNext() (n interface{}, err error) {
return o.GetNext()
}
+
+type <T>_Ø struct{}
+
+func (o *<T>_Ø) GetNext() (*<T>, error) {
+ return nil, nil
+}
+func (o *<T>_Ø) GenericGetNext() (interface{}, error) {
+ return nil, nil
+}