summaryrefslogtreecommitdiff
path: root/src/nslcd_proto/util/enumerator@T.got
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 00:43:54 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 00:43:54 -0600
commit955e8e2dc4bd7865f2b21139d61424a168e5a041 (patch)
tree89c135b5531d5562b84d250c78dc1422e4c0becf /src/nslcd_proto/util/enumerator@T.got
parent79f7c721b7275208bb2bef0fec87e1a732353b74 (diff)
The way nslcd_proto's GenericGetNext was designed, nil checks didn't work
Diffstat (limited to 'src/nslcd_proto/util/enumerator@T.got')
-rw-r--r--src/nslcd_proto/util/enumerator@T.got11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nslcd_proto/util/enumerator@T.got b/src/nslcd_proto/util/enumerator@T.got
index e1dd2ae..5ce5cb5 100644
--- a/src/nslcd_proto/util/enumerator@T.got
+++ b/src/nslcd_proto/util/enumerator@T.got
@@ -22,8 +22,13 @@ func (o *<T>_List) GetNext() (n *nslcd_proto.<T>, err error) {
return
}
-func (o *<T>_List) GenericGetNext() (n interface{}, err error) {
- return o.GetNext()
+func (o *<T>_List) GenericGetNext() (n *interface{}, err error) {
+ a, err := o.GetNext()
+ if a != nil {
+ b := (interface{})(*a)
+ n = &b
+ }
+ return
}
type <T>_Ø struct{}
@@ -33,7 +38,7 @@ var _ nslcd_proto.<T>_Enumerator = <T>_Ø{}
func (o <T>_Ø) GetNext() (*nslcd_proto.<T>, error) {
return nil, nil
}
-func (o <T>_Ø) GenericGetNext() (interface{}, error) {
+func (o <T>_Ø) GenericGetNext() (*interface{}, error) {
return nil, nil
}