summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'git.go')
-rw-r--r--git.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/git.go b/git.go
index 28196c8..4c798b3 100644
--- a/git.go
+++ b/git.go
@@ -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)