aliyun / alibaba-cloud-sdk-go

Alibaba Cloud SDK for Go
Apache License 2.0
1.16k stars 273 forks source link

panic: interface conversion: interface {} is float64, not string #534

Open Shinku-Chen opened 2 years ago

Shinku-Chen commented 2 years ago

 client :=eas.NewClientWithAccessKey(AkInfo.Region, AkInfo.AccessKeyID, AkInfo.AccessKeySecret) 
    client.SetEndpointRules(map[string]string{"cn-beijing": "pai-eas.cn-beijing.aliyuncs.com"}, paistudio.GetEndpointType(), "")
    request := eas.CreateModifyServiceRequest()
    request.Region = ResponseBody.Region
    request.ServiceName = ResponseBody.ServiceName
client.ModifyService(request); 

/Users/Shinku/go/go1.17.1/pkg/mod/github.com/aliyun/alibaba-cloud-sdk-go@v1.61.1319/sdk/errors/server_error.go

result.errorCode = errorCode.(string)会panic 因为此时errorCode为float64

panic: interface conversion: interface {} is float64, not string