summaryrefslogtreecommitdiff
path: root/walk.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2013-09-12 10:46:20 +0200
committerCarlos Martín Nieto <[email protected]>2013-09-12 10:46:20 +0200
commitb5aca803db4cf9adce0a037cc5ccc47c4c045510 (patch)
tree0280a0e5148bff28de858393bdfc1e1420d3b799 /walk.go
parent00e3df94c7e06ab66fe4618d3252458163e4a404 (diff)
Give each const group a type
This allows us to restrict which constants the compiler will allow through, and makes the sorting in the documentation better.
Diffstat (limited to 'walk.go')
-rw-r--r--walk.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/walk.go b/walk.go
index 1d560b6..6525db1 100644
--- a/walk.go
+++ b/walk.go
@@ -13,11 +13,12 @@ import (
// RevWalk
+type SortType uint
const (
- SortNone = C.GIT_SORT_NONE
- SortTopological = C.GIT_SORT_TOPOLOGICAL
- SortTime = C.GIT_SORT_TIME
- SortReverse = C.GIT_SORT_REVERSE
+ SortNone SortType = C.GIT_SORT_NONE
+ SortTopological = C.GIT_SORT_TOPOLOGICAL
+ SortTime = C.GIT_SORT_TIME
+ SortReverse = C.GIT_SORT_REVERSE
)
type RevWalk struct {
@@ -81,7 +82,7 @@ func (v *RevWalk) Iterate(fun RevWalkIterator) (err error) {
return nil
}
-func (v *RevWalk) Sorting(sm uint) {
+func (v *RevWalk) Sorting(sm SortType) {
C.git_revwalk_sorting(v.ptr, C.uint(sm))
}