diff options
| author | Carlos Martín Nieto <[email protected]> | 2014-03-18 05:04:26 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2014-03-19 03:56:50 +0100 |
| commit | c9c7c1e77942f88955af0dc3bdfb58d5e7d7f121 (patch) | |
| tree | 7dc7c3acc894d630d175bd5fdc1fcda7d650c0a1 /git.go | |
| parent | b6703d47671b3a736e8b93ff0447da45e688865c (diff) | |
Oid: make NewOid take a string
This is the most common way of having an id that's not in Oid form, so
let's make it the "default" and rename to NewOidFromBytes() the one that
takes []byte.
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -41,7 +41,7 @@ func newOidFromC(coid *C.git_oid) *Oid { return oid } -func NewOid(b []byte) *Oid { +func NewOidFromBytes(b []byte) *Oid { oid := new(Oid) copy(oid[0:20], b[0:20]) return oid @@ -51,7 +51,7 @@ func (oid *Oid) toC() *C.git_oid { return (*C.git_oid)(unsafe.Pointer(oid)) } -func NewOidFromString(s string) (*Oid, error) { +func NewOid(s string) (*Oid, error) { o := new(Oid) cs := C.CString(s) defer C.free(unsafe.Pointer(cs)) |
