Skip to content

Commit 3d5dab0

Browse files
authored
fix(nameserver): panic in nameserver size is changed. (#529)
1 parent 80b3acc commit 3d5dab0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/namesrv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (s *namesrvs) getNameServerAddress() string {
120120
s.lock.Lock()
121121
defer s.lock.Unlock()
122122

123-
addr := s.srvs[s.index]
123+
addr := s.srvs[s.index%len(s.srvs)]
124124
index := s.index + 1
125125
if index < 0 {
126126
index = -index

0 commit comments

Comments
 (0)