packagendrimport("fmt""reflect")func(dec*Decoder)fillPipe(vreflect.Value,tagreflect.StructTag)error{s,err:=dec.readUint32()// read element count of first chunkiferr!=nil{returnerr}a:=reflect.MakeSlice(v.Type(),0,0)c:=reflect.MakeSlice(v.Type(),int(s),int(s))fors!=0{fori:=0;i<int(s);i++{err:=dec.fill(c.Index(i),tag,&[]deferedPtr{})iferr!=nil{returnfmt.Errorf("could not fill element %d of pipe: %v",i,err)}}s,err=dec.readUint32()// read element count of first chunkiferr!=nil{returnerr}a=reflect.AppendSlice(a,c)c=reflect.MakeSlice(v.Type(),int(s),int(s))}v.Set(a)returnnil}