1package client // import "github.com/docker/docker/client" 2 3import ( 4 "context" 5 "net/url" 6) 7 8// SwarmLeave leaves the swarm. 9func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 10 query := url.Values{} 11 if force { 12 query.Set("force", "1") 13 } 14 resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 15 ensureReaderClosed(resp) 16 return err 17} 18