mirror of https://github.com/ceph/go-ceph
Make example more golang
This commit is contained in:
parent
28db807c97
commit
f34b1cc12a
10
README.md
10
README.md
|
@ -51,14 +51,14 @@ similar to a standard file I/O interface:
|
||||||
ioctx, err := conn.OpenIOContext("mypool")
|
ioctx, err := conn.OpenIOContext("mypool")
|
||||||
|
|
||||||
// write some data
|
// write some data
|
||||||
bytes_in := []byte("input data")
|
bytesIn := []byte("input data")
|
||||||
err = ioctx.Write("obj", bytes_in, 0)
|
err = ioctx.Write("obj", bytesIn, 0)
|
||||||
|
|
||||||
// read the data back out
|
// read the data back out
|
||||||
bytes_out := make([]byte, len(bytes_in))
|
bytesOut := make([]byte, len(bytesIn))
|
||||||
n_out, err := ioctx.Read("obj", bytes_out, 0)
|
_, err := ioctx.Read("obj", bytesOut, 0)
|
||||||
|
|
||||||
if bytes_in != bytes_out {
|
if !bytes.Equal(bytesIn, bytesOut) {
|
||||||
fmt.Println("Output is not input!")
|
fmt.Println("Output is not input!")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue