You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method = strings.ToUpper(method)
client, uri := getClient(c, uri, withLog, method)
for _, f := range options {
f(client)
}
r := client.R().SetContext(c)
//default header
if method == resty.MethodPost || method == resty.MethodPut {
r.SetHeader("content-type", "application/json")
}
for h, v := range headers {
r.SetHeader(h, v)
}
// request id
if !strings.Contains(uri, common.RequestId) {
tmpReqId := common.GetRequestId(c)
if tmpReqId == "" {
tmpReqId = uuid.NewString()
c = context.WithValue(c, common.RequestId, tmpReqId)
}
r.SetQueryParam(common.RequestId, tmpReqId)
}`
When the project starts, a resty client is initialized. This client is reused for requests, and headers are set on the client using client.R() when initializing a request. However, there are occasional occurrences of concurrent map iteration and map write. Why does this happen?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
`
When the project starts, a resty client is initialized. This client is reused for requests, and headers are set on the client using client.R() when initializing a request. However, there are occasional occurrences of concurrent map iteration and map write. Why does this happen?
Beta Was this translation helpful? Give feedback.
All reactions