Explorar o código

eof is not error

Tao Wen %!s(int64=8) %!d(string=hai) anos
pai
achega
5cb0d35610
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      feature_adapter.go

+ 4 - 0
feature_adapter.go

@@ -111,6 +111,10 @@ type AdaptedDecoder struct {
 
 func (adapter *AdaptedDecoder) Decode(obj interface{}) error {
 	adapter.iter.ReadVal(obj)
+	err := adapter.iter.Error
+	if err == io.EOF {
+		return nil
+	}
 	return adapter.iter.Error
 }