Merge pull request #269 from durin42/small-fixes
Small fixes I noticed while perusing the code.
This commit is contained in:
commit
f05a6a3384
|
@ -18,10 +18,22 @@ func setupConfig() (*Config, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
c.SetString("foo.bar", "baz")
|
||||
c.SetBool("foo.bool", true)
|
||||
c.SetInt32("foo.int32", 32)
|
||||
c.SetInt64("foo.int64", 64)
|
||||
err = c.SetString("foo.bar", "baz")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = c.SetBool("foo.bool", true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = c.SetInt32("foo.int32", 32)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = c.SetInt64("foo.int64", 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return c, err
|
||||
}
|
||||
|
@ -86,6 +98,7 @@ func TestConfigLookups(t *testing.T) {
|
|||
|
||||
if err != nil {
|
||||
t.Errorf("Setup error: '%v'. Expected none\n", err)
|
||||
return
|
||||
}
|
||||
defer c.Free()
|
||||
|
||||
|
|
4
odb.go
4
odb.go
|
@ -11,7 +11,6 @@ import (
|
|||
"reflect"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Odb struct {
|
||||
|
@ -107,9 +106,7 @@ func odbForEachCb(id *C.git_oid, handle unsafe.Pointer) int {
|
|||
}
|
||||
|
||||
err := data.callback(newOidFromC(id))
|
||||
fmt.Println("err %v", err)
|
||||
if err != nil {
|
||||
fmt.Println("returning EUSER")
|
||||
data.err = err
|
||||
return C.GIT_EUSER
|
||||
}
|
||||
|
@ -130,7 +127,6 @@ func (v *Odb) ForEach(callback OdbForEachCallback) error {
|
|||
defer pointerHandles.Untrack(handle)
|
||||
|
||||
ret := C._go_git_odb_foreach(v.ptr, handle)
|
||||
fmt.Println("ret %v", ret);
|
||||
if ret == C.GIT_EUSER {
|
||||
return data.err
|
||||
} else if ret < 0 {
|
||||
|
|
Loading…
Reference in New Issue