Skip to content

Commit b6529df

Browse files
committed
fix random port
1 parent b72e397 commit b6529df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

address/common.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ func CheckHostPort(addr string) string {
3737
hp := strings.Split(addr, ":")
3838
if len(hp) != 2 {
3939
tmp := make([]string, 2)
40-
copy(hp, tmp)
40+
for i, s := range hp {
41+
if i > 1 {
42+
break
43+
}
44+
tmp[i] = s
45+
}
4146
hp = tmp
4247
}
4348
if len(hp[0]) == 0 {

0 commit comments

Comments
 (0)