You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// write some databytes_in:= []byte("input data")
err=ioctx.Write("obj", bytes_in, 0)
// read the data back outbytes_out:=make([]byte, len(bytes_in))
n_out, err:=ioctx.Read("obj", bytes_out, 0)
ifbytes_in!=bytes_out {
fmt.Println("Output is not input!")
}
But that final comparison isn't valid Go. You can only compare a slice to nil, not to other slices.
So that example wouldn't even compile.
(Lesser nit: Go doesn't use underscores in variable names, so idiomatic Go would be bytesIn and bytesOut)
The text was updated successfully, but these errors were encountered:
https://github.com/ceph/go-ceph#object-io has the code:
But that final comparison isn't valid Go. You can only compare a slice to
nil
, not to other slices.So that example wouldn't even compile.
(Lesser nit: Go doesn't use underscores in variable names, so idiomatic Go would be
bytesIn
andbytesOut
)The text was updated successfully, but these errors were encountered: