Add func (c Commit) Time() time.Time

This commit is contained in:
Ervin Oro 2017-10-01 15:37:16 +03:00
parent 334260d743
commit 06719bcfd6
1 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import "C"
import (
"runtime"
"time"
"unsafe"
)
@ -18,6 +19,10 @@ type Commit struct {
cast_ptr *C.git_commit
}
func (c Commit) Time() time.Time {
return time.Unix(int64(C.git_commit_time(c.cast_ptr)), 0)
}
func (c Commit) Message() string {
return C.GoString(C.git_commit_message(c.cast_ptr))
}