Skip to content

Commit 8ebf305

Browse files
committed
修改通过InstanceID查询数据的方法参数类型,由int改为正确的string
1 parent 3d4e04c commit 8ebf305

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

internal/deploy/service/internal_utils.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"math/rand"
66
"net"
77
"os/exec"
8-
"strconv"
98
"sync"
109
"time"
1110

@@ -61,11 +60,6 @@ func GetInstanceIP(instanceID string) (string, error) {
6160
return "", fmt.Errorf("instanceID cannot be empty")
6261
}
6362

64-
// 验证instanceID是否为有效的数字(因为数据库中id是SERIAL类型)
65-
if _, err := strconv.Atoi(instanceID); err != nil {
66-
return "", fmt.Errorf("invalid instanceID format: %s, must be a number", instanceID)
67-
}
68-
6963
// 获取数据库连接
7064
_, err := initDatabase()
7165
if err != nil {
@@ -88,11 +82,6 @@ func GetInstancePort(instanceID string) (int, error) {
8882
return 0, fmt.Errorf("instanceID cannot be empty")
8983
}
9084

91-
// 验证instanceID是否为有效的数字(因为数据库中id是SERIAL类型)
92-
if _, err := strconv.Atoi(instanceID); err != nil {
93-
return 0, fmt.Errorf("invalid instanceID format: %s, must be a number", instanceID)
94-
}
95-
9685
// 获取数据库连接
9786
_, err := initDatabase()
9887
if err != nil {

0 commit comments

Comments
 (0)