go fmt
This commit is contained in:
parent
e439b931a6
commit
45d88ca5f4
|
@ -29,8 +29,8 @@ type gitObject struct {
|
|||
repo *Repository
|
||||
}
|
||||
|
||||
func (t ObjectType) String() (string) {
|
||||
switch (t) {
|
||||
func (t ObjectType) String() string {
|
||||
switch t {
|
||||
case ObjectAny:
|
||||
return "Any"
|
||||
case ObjectBad:
|
||||
|
|
4
odb.go
4
odb.go
|
@ -111,7 +111,7 @@ func odbForEachCb(id *C.git_oid, payload unsafe.Pointer) int {
|
|||
}
|
||||
|
||||
func (v *Odb) ForEach(callback OdbForEachCallback) error {
|
||||
data := foreachData {
|
||||
data := foreachData{
|
||||
callback: callback,
|
||||
err: nil,
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error) {
|
|||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
ret := C.git_odb_hash(oid.toC(), ptr, C.size_t(header.Len), C.git_otype(otype));
|
||||
ret := C.git_odb_hash(oid.toC(), ptr, C.size_t(header.Len), C.git_otype(otype))
|
||||
if ret < 0 {
|
||||
return nil, MakeGitError(ret)
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package git
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ func statusEntryFromC(statusEntry *C.git_status_entry) StatusEntry {
|
|||
indexToWorkdir = diffDeltaFromC(statusEntry.index_to_workdir)
|
||||
}
|
||||
|
||||
return StatusEntry {
|
||||
return StatusEntry{
|
||||
Status: Status(statusEntry.status),
|
||||
HeadToIndex: headToIndex,
|
||||
IndexToWorkdir: indexToWorkdir,
|
||||
|
@ -173,7 +173,6 @@ func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) {
|
|||
return newStatusListFromC(ptr), nil
|
||||
}
|
||||
|
||||
|
||||
func (v *Repository) StatusFile(path string) (Status, error) {
|
||||
var statusFlags C.uint
|
||||
cPath := C.CString(path)
|
||||
|
|
|
@ -2,8 +2,8 @@ package git
|
|||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestCreateTag(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue