diff options
| author | Jesse Ezell <[email protected]> | 2014-03-20 21:56:41 -0700 |
|---|---|---|
| committer | Jesse Ezell <[email protected]> | 2014-03-20 21:56:41 -0700 |
| commit | d0b334b24409ddc190a7010be0072d87df6b6bfe (patch) | |
| tree | fb434c1f8182296b2a80bdf1939e09ddca021e68 /git.go | |
| parent | 9acd67e388b6fccf982c9206dc5326ae35c13f49 (diff) | |
cleanup and refactor diff / patch
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -10,8 +10,8 @@ import ( "bytes" "errors" "runtime" - "unsafe" "strings" + "unsafe" ) const ( @@ -22,6 +22,7 @@ const ( var ( ErrIterOver = errors.New("Iteration is over") + ErrInvalid = errors.New("Invalid state for operation") ) func init() { @@ -93,7 +94,7 @@ func (oid *Oid) Equal(oid2 *Oid) bool { } func (oid *Oid) IsZero() bool { - for _, a := range(oid.bytes) { + for _, a := range oid.bytes { if a != '0' { return false } @@ -131,10 +132,10 @@ func ShortenOids(ids []*Oid, minlen int) (int, error) { type GitError struct { Message string - Code int + Code int } -func (e GitError) Error() string{ +func (e GitError) Error() string { return e.Message } @@ -147,14 +148,14 @@ func LastError() error { } func cbool(b bool) C.int { - if (b) { + if b { return C.int(1) } return C.int(0) } func ucbool(b bool) C.uint { - if (b) { + if b { return C.uint(1) } return C.uint(0) |
