Add func (c Commit) Time() time.Time
This commit is contained in:
parent
334260d743
commit
06719bcfd6
|
@ -9,6 +9,7 @@ import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,6 +19,10 @@ type Commit struct {
|
||||||
cast_ptr *C.git_commit
|
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 {
|
func (c Commit) Message() string {
|
||||||
return C.GoString(C.git_commit_message(c.cast_ptr))
|
return C.GoString(C.git_commit_message(c.cast_ptr))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue