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:
		| @@ -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, | ||||
| 	} | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user