1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-10-30 23:47:59 +02:00

fix: replace strconv.Itoa with strconv.FormatInt for int64 handling (#3667)

Co-authored-by: huangzw <huangzw@2345.com>
This commit is contained in:
Name
2025-07-31 16:40:34 +08:00
committed by GitHub
parent 4b104e99c9
commit f7f150c3f1
2 changed files with 2 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ func toServiceInstance(ins *discoveryInstance) *registry.ServiceInstance {
md := map[string]string{
"region": ins.Region,
"zone": ins.Zone,
"lastTs": strconv.Itoa(int(ins.LastTs)),
"lastTs": strconv.FormatInt(ins.LastTs, 10),
"env": ins.Env,
"hostname": ins.Hostname,
}

View File

@@ -203,7 +203,7 @@ func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registr
Metadata: in.Metadata,
Endpoints: []string{kind + "://" + net.JoinHostPort(in.Ip, strconv.Itoa(int(in.Port)))},
}
r.Metadata["weight"] = strconv.Itoa(int(math.Ceil(weight)))
r.Metadata["weight"] = strconv.FormatInt(int64(math.Ceil(weight)), 10)
items = append(items, r)
}
return items, nil