1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/client/build_cancel.go
Sebastiaan van Stijn 4c0a050ee2
Remove stray uses of "golang.org/x/net/context"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-13 09:53:36 +02:00

20 lines
431 B
Go

package client // import "github.com/docker/docker/client"
import (
"context"
"net/url"
)
// BuildCancel requests the daemon to cancel ongoing build request
func (cli *Client) BuildCancel(ctx context.Context, id string) error {
query := url.Values{}
query.Set("id", id)
serverResp, err := cli.post(ctx, "/build/cancel", query, nil, nil)
if err != nil {
return err
}
defer ensureReaderClosed(serverResp)
return nil
}