Skip to content

Commit b42a131

Browse files
author
1911860538
committed
etcdserver: replace ParseInt with Atoi in getClusterSize
Signed-off-by: 1911860538 <[email protected]>
1 parent 316991e commit b42a131

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: server/etcdserver/api/v3discovery/discovery.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ func (d *discovery) getClusterSize() (int, error) {
246246
return 0, ErrSizeNotFound
247247
}
248248

249-
clusterSize, err := strconv.ParseInt(string(resp.Kvs[0].Value), 10, 0)
249+
clusterSize, err := strconv.Atoi(string(resp.Kvs[0].Value))
250250
if err != nil || clusterSize <= 0 {
251251
return 0, ErrBadSizeKey
252252
}
253253

254-
return int(clusterSize), nil
254+
return clusterSize, nil
255255
}
256256

257257
func (d *discovery) getClusterMembers() (*clusterInfo, int64, error) {

0 commit comments

Comments
 (0)