From dbe032c347b1a1308a4b880e7c5a06d8dfb4d507 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sun, 5 Sep 2021 13:59:36 -0700 Subject: Make all non-user-creatable structures non-comparable (#802) This change makes all non-user-creatable structures non-comparable. This makes it easier to add changes later that don't introduce breaking changes from the go compatibility guarantees perspective. This, of course, implies that this change _is_ a breaking change, but since these structures are not intended to be created by users (or de-referenced), it should be okay. --- index.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'index.go') diff --git a/index.go b/index.go index 99dbd7a..48c922c 100644 --- a/index.go +++ b/index.go @@ -52,6 +52,7 @@ const ( ) type Index struct { + doNotCompare ptr *C.git_index repo *Repository } @@ -108,7 +109,7 @@ func freeCIndexEntry(entry *C.git_index_entry) { } func newIndexFromC(ptr *C.git_index, repo *Repository) *Index { - idx := &Index{ptr, repo} + idx := &Index{ptr: ptr, repo: repo} runtime.SetFinalizer(idx, (*Index).Free) return idx } @@ -616,6 +617,7 @@ func (v *Index) RemoveConflict(path string) error { } type IndexConflictIterator struct { + doNotCompare ptr *C.git_index_conflict_iterator index *Index } -- cgit v1.2.3