diff options
| author | lhchavez <[email protected]> | 2020-05-09 20:39:51 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-09 20:39:51 -0700 |
| commit | 31f877e249e28c29cc4fcd512381a5a5b26e59d9 (patch) | |
| tree | eba9030b1449cddf6274b748fbfcf010680d35cd /diff.go | |
| parent | 8b51d0db8e40e97283b771a5a51b13bea4651f81 (diff) | |
| parent | cf6522c7fe093244a14334ced1c90c9791231a3e (diff) | |
Merge pull request #582 from suhaibmujahid/method-rename
It is not Go idiomatic to put Get into the getter's name
Diffstat (limited to 'diff.go')
| -rw-r--r-- | diff.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -144,7 +144,7 @@ func (diff *Diff) NumDeltas() (int, error) { return ret, nil } -func (diff *Diff) GetDelta(index int) (DiffDelta, error) { +func (diff *Diff) Delta(index int) (DiffDelta, error) { if diff.ptr == nil { return DiffDelta{}, ErrInvalid } @@ -154,6 +154,11 @@ func (diff *Diff) GetDelta(index int) (DiffDelta, error) { return ret, nil } +// deprecated: You should use `Diff.Delta()` instead. +func (diff *Diff) GetDelta(index int) (DiffDelta, error) { + return diff.Delta(index) +} + func newDiffFromC(ptr *C.git_diff, repo *Repository) *Diff { if ptr == nil { return nil |
