-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for context.Context #4059
Comments
The API for canceling a build is here: https://esbuild.github.io/api/#cancel |
As per your code in your docs: https://esbuild.github.io/api/#cancel ctx, err := api.Context(api.BuildOptions{...})
if err != nil { <------------------------------Doesn't work in the way of idiomatic Go
return err
} Maybe api.Context should return a standard untyped The workaround doesn't look nice: ctx, err := api.Context(api.BuildOptions{...})
if err.(*api.ContextError) != nil {
} |
Sorry, I'm confused. Your first example with
|
See: https://github.com/romance-dev/go-bundler/blob/main/bundler.go#L139 (unlicensed for the time being) |
It would be good if the API can support
ctx context.Context
to cancel builds.The text was updated successfully, but these errors were encountered: