mirror of https://github.com/ceph/go-ceph
run gofmt on all sources
This commit is contained in:
parent
d2c4761f9f
commit
0c6bdf8d59
|
@ -1,8 +1,8 @@
|
|||
package rados
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestImports(t *testing.T) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package rados_test
|
||||
|
||||
import "testing"
|
||||
|
||||
//import "bytes"
|
||||
import "github.com/noahdesu/go-ceph/rados"
|
||||
import "github.com/stretchr/testify/assert"
|
||||
|
|
11
rbd/rbd.go
11
rbd/rbd.go
|
@ -7,16 +7,17 @@ package rbd
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/noahdesu/go-ceph/rados"
|
||||
"fmt"
|
||||
"unsafe"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/noahdesu/go-ceph/rados"
|
||||
"io"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
//
|
||||
type RBDError int
|
||||
|
||||
var ImageNotOpen = errors.New("RBD image not open")
|
||||
|
||||
//
|
||||
|
@ -176,7 +177,7 @@ func Create(ioctx *rados.IOContext, name string, size uint64,
|
|||
// const char *c_name, uint64_t features, int *c_order,
|
||||
// uint64_t stripe_unit, int stripe_count);
|
||||
func (image *Image) Clone(snapname string, c_ioctx *rados.IOContext, c_name string, features uint64) (*Image, error) {
|
||||
var c_order C.int;
|
||||
var c_order C.int
|
||||
var c_p_name *C.char = C.CString(image.name)
|
||||
var c_p_snapname *C.char = C.CString(snapname)
|
||||
var c_c_name *C.char = C.CString(c_name)
|
||||
|
@ -247,7 +248,7 @@ func (image *Image) Open(args ...interface{}) error {
|
|||
}
|
||||
}
|
||||
|
||||
if (read_only) {
|
||||
if read_only {
|
||||
ret = C.rbd_open_read_only(C.rados_ioctx_t(image.ioctx.Pointer()), c_name,
|
||||
&c_image, c_snap_name)
|
||||
} else {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package rbd_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"encoding/json"
|
||||
"github.com/noahdesu/go-ceph/rados"
|
||||
"github.com/noahdesu/go-ceph/rbd"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os/exec"
|
||||
"sort"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func GetUUID() string {
|
||||
|
@ -49,7 +49,7 @@ func TestGetImageNames(t *testing.T) {
|
|||
sort.Strings(imageNames)
|
||||
assert.Equal(t, createdList, imageNames)
|
||||
|
||||
for _, name := range(createdList) {
|
||||
for _, name := range createdList {
|
||||
img := rbd.GetImage(ioctx, name)
|
||||
err := img.Remove()
|
||||
assert.NoError(t, err)
|
||||
|
|
Loading…
Reference in New Issue