(ctx context.Context)
| 76 | } |
| 77 | |
| 78 | func (p *PikPak) WithContext(ctx context.Context) *PikPak { |
| 79 | if p == nil { |
| 80 | return nil |
| 81 | } |
| 82 | clone := *p |
| 83 | if ctx == nil { |
| 84 | ctx = context.Background() |
| 85 | } |
| 86 | clone.ctx = ctx |
| 87 | return &clone |
| 88 | } |
| 89 | |
| 90 | func (p *PikPak) newRequest(method, url string, body io.Reader) (*http.Request, error) { |
| 91 | return http.NewRequestWithContext(p.requestContext(), method, url, body) |
no outgoing calls