Clever / wag

sWAGger - Web API Generator
Apache License 2.0
77 stars 6 forks source link

Remove golang.org/x/net/context/ctxhttp from generated client. #427

Closed taylor-sutton closed 1 year ago

taylor-sutton commented 2 years ago

We use this package to make sure context is respected when performing client requests: https://github.com/Clever/wag/blob/e1e9b5bbdd8c9b945e00c2be9d4fe5d19ebda906/samples/gen-go/client/doer.go#L33

However, you can see from the source of the modern version of this package that we don't need this any more; the package was meant to bridge the gap from old versions of Go and new versions of Go. But in new versions of Go, the request's context is respected by the client, as you can see from the source of the current version of ctxhttp: https://cs.opensource.google/go/x/net/+/2871e0cb:context/ctxhttp/ctxhttp.go;l=23

So we can just remove the use of this package altogether.

taylor-sutton commented 1 year ago

Fixed now!