mirror of https://github.com/ceph/go-ceph
Merge pull request #23 from theanalyst/wip-gofmt
go fmt the source files and add travis check for go fmt
This commit is contained in:
commit
8f882afdc3
|
@ -20,6 +20,7 @@ before_install:
|
|||
script:
|
||||
- go get -t -v ./...
|
||||
- go test -v ./...
|
||||
- go fmt ./...
|
||||
|
||||
notifications:
|
||||
recipients:
|
||||
|
|
|
@ -340,12 +340,12 @@ func (ioctx *IOContext) SetOmap(oid string, pairs map[string][]byte) error {
|
|||
i := 0
|
||||
for key, value := range pairs {
|
||||
// key
|
||||
c_key_ptr := (**C.char)(unsafe.Pointer(uintptr(c_keys) + uintptr(i) * ptrSize))
|
||||
c_key_ptr := (**C.char)(unsafe.Pointer(uintptr(c_keys) + uintptr(i)*ptrSize))
|
||||
*c_key_ptr = C.CString(key)
|
||||
defer C.free(unsafe.Pointer(*c_key_ptr))
|
||||
|
||||
// value and its length
|
||||
c_value_ptr := (**C.char)(unsafe.Pointer(uintptr(c_values) + uintptr(i) * ptrSize))
|
||||
c_value_ptr := (**C.char)(unsafe.Pointer(uintptr(c_values) + uintptr(i)*ptrSize))
|
||||
|
||||
var c_length C.size_t
|
||||
if len(value) > 0 {
|
||||
|
@ -356,7 +356,7 @@ func (ioctx *IOContext) SetOmap(oid string, pairs map[string][]byte) error {
|
|||
c_length = C.size_t(0)
|
||||
}
|
||||
|
||||
c_length_ptr := (*C.size_t)(unsafe.Pointer(uintptr(c_lengths) + uintptr(i) * ptrSize))
|
||||
c_length_ptr := (*C.size_t)(unsafe.Pointer(uintptr(c_lengths) + uintptr(i)*ptrSize))
|
||||
*c_length_ptr = c_length
|
||||
|
||||
i++
|
||||
|
@ -472,7 +472,7 @@ func (ioctx *IOContext) GetAllOmapValues(oid string, startAfter string, filterPr
|
|||
for {
|
||||
err := ioctx.ListOmapValues(
|
||||
oid, startAfter, filterPrefix, iteratorSize,
|
||||
func (key string, value []byte) {
|
||||
func(key string, value []byte) {
|
||||
omap[key] = value
|
||||
startAfter = key
|
||||
},
|
||||
|
@ -506,7 +506,7 @@ func (ioctx *IOContext) RmOmapKeys(oid string, keys []string) error {
|
|||
|
||||
i := 0
|
||||
for _, key := range keys {
|
||||
c_key_ptr := (**C.char)(unsafe.Pointer(uintptr(c_keys) + uintptr(i) * ptrSize))
|
||||
c_key_ptr := (**C.char)(unsafe.Pointer(uintptr(c_keys) + uintptr(i)*ptrSize))
|
||||
*c_key_ptr = C.CString(key)
|
||||
defer C.free(unsafe.Pointer(*c_key_ptr))
|
||||
i++
|
||||
|
|
|
@ -705,4 +705,3 @@ func TestReadFilterOmap(t *testing.T) {
|
|||
|
||||
pool.Destroy()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue