Run go fmt

As it seems to be something that many people can't get over, reformat
all the files; as we're breaking things, whoever depended on 'next' will
have to take many changes into account anyway, so let's include this to
reduce the noise of incoming patches.
This commit is contained in:
Carlos Martín Nieto 2015-08-31 20:22:17 +02:00
parent 876ddd17eb
commit d5890f58e8
7 changed files with 32 additions and 32 deletions

View File

@ -51,8 +51,8 @@ func newIndexEntryFromC(entry *C.git_index_entry) *IndexEntry {
return nil
}
return &IndexEntry{
IndexTime { int32(entry.ctime.seconds), uint32(entry.ctime.nanoseconds) },
IndexTime { int32(entry.mtime.seconds), uint32(entry.mtime.nanoseconds) },
IndexTime{int32(entry.ctime.seconds), uint32(entry.ctime.nanoseconds)},
IndexTime{int32(entry.mtime.seconds), uint32(entry.mtime.nanoseconds)},
Filemode(entry.mode),
uint32(entry.uid),
uint32(entry.gid),
@ -280,7 +280,7 @@ func (v *Index) ReadTree(tree *Tree) error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_index_read_tree(v.ptr, tree.cast_ptr);
ret := C.git_index_read_tree(v.ptr, tree.cast_ptr)
if ret < 0 {
return MakeGitError(ret)
}

View File

@ -259,7 +259,7 @@ func (r *Repository) MergeBases(one, two *Oid) ([]*Oid, error) {
}
oids := make([]*Oid, coids.count)
hdr := reflect.SliceHeader {
hdr := reflect.SliceHeader{
Data: uintptr(unsafe.Pointer(coids.ids)),
Len: int(coids.count),
Cap: int(coids.count),

4
odb.go
View File

@ -8,10 +8,10 @@ extern void _go_git_odb_backend_free(git_odb_backend *backend);
*/
import "C"
import (
"fmt"
"reflect"
"runtime"
"unsafe"
"fmt"
)
type Odb struct {
@ -130,7 +130,7 @@ 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);
fmt.Println("ret %v", ret)
if ret == C.GIT_EUSER {
return data.err
} else if ret < 0 {

View File

@ -588,7 +588,7 @@ func (o *Remote) RefspecCount() uint {
func populateFetchOptions(options *C.git_fetch_options, opts *FetchOptions) {
C.git_fetch_init_options(options, C.GIT_FETCH_OPTIONS_VERSION)
if opts == nil {
return;
return
}
populateRemoteCallbacks(&options.callbacks, &opts.RemoteCallbacks)
options.prune = C.git_fetch_prune_t(opts.Prune)
@ -624,7 +624,7 @@ func (o *Remote) Fetch(refspecs []string, opts *FetchOptions, msg string) error
defer freeStrarray(&crefspecs)
var coptions C.git_fetch_options
populateFetchOptions(&coptions, opts);
populateFetchOptions(&coptions, opts)
defer untrackCalbacksPayload(&coptions.callbacks)
runtime.LockOSThread()
@ -646,7 +646,7 @@ func (o *Remote) ConnectPush(callbacks *RemoteCallbacks) error {
}
func (o *Remote) Connect(direction ConnectDirection, callbacks *RemoteCallbacks) error {
var ccallbacks C.git_remote_callbacks;
var ccallbacks C.git_remote_callbacks
populateRemoteCallbacks(&ccallbacks, callbacks)
runtime.LockOSThread()
@ -729,7 +729,7 @@ func (o *Remote) PruneRefs() bool {
}
func (o *Remote) Prune(callbacks *RemoteCallbacks) error {
var ccallbacks C.git_remote_callbacks;
var ccallbacks C.git_remote_callbacks
populateRemoteCallbacks(&ccallbacks, callbacks)
runtime.LockOSThread()

View File

@ -39,7 +39,7 @@ func TestCertificateCheck(t *testing.T) {
remote, err := repo.Remotes.Create("origin", "https://github.com/libgit2/TestGitRepository")
checkFatal(t, err)
options := FetchOptions {
options := FetchOptions{
RemoteCallbacks: RemoteCallbacks{
CertificateCheckCallback: func(cert *Certificate, valid bool, hostname string) ErrorCode {
return assertHostname(cert, valid, hostname, t)