clientv3: change keepAlive Close() to close()
keepAlive is a private struct that belongs to clientv3 pkg and shouldn't expose a public Close() method.
@@ -386,7 +386,7 @@ func (l *lessor) recvKeepAliveLoop() (gerr error) {
close(l.donec)
l.loopErr = gerr
for _, ka := range l.keepAlives {
- ka.Close()
+ ka.close()
}
l.keepAlives = make(map[LeaseID]*keepAlive)
l.mu.Unlock()
@@ -467,7 +467,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) {
if karesp.TTL <= 0 {
// lease expired; close all keep alive channels
delete(l.keepAlives, karesp.ID)
- ka.Close()
+ ka.close()
return
}
@@ -497,7 +497,7 @@ func (l *lessor) deadlineLoop() {
for id, ka := range l.keepAlives {
if ka.deadline.Before(now) {
// waited too long for response; lease may be expired
- ka.Close()
+ ka.close()
delete(l.keepAlives, id)
}
}
@@ -539,7 +539,7 @@ func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) {
}
}
-func (ka *keepAlive) Close() {
+func (ka *keepAlive) close() {
close(ka.donec)
for _, ch := range ka.chs {
close(ch)
