Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 37ccc00d0e
Component: cli
This commit is contained in:
@ -8,12 +8,13 @@ import (
|
||||
)
|
||||
|
||||
// NewNetworkCommand returns a cobra command for `network` subcommands
|
||||
// nolint: interfacer
|
||||
func NewNetworkCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "network",
|
||||
Short: "Manage networks",
|
||||
Args: cli.NoArgs,
|
||||
RunE: dockerCli.ShowHelp,
|
||||
RunE: command.ShowHelp(dockerCli.Err()),
|
||||
}
|
||||
cmd.AddCommand(
|
||||
newConnectCommand(dockerCli),
|
||||
|
||||
@ -17,7 +17,7 @@ type pruneOptions struct {
|
||||
}
|
||||
|
||||
// NewPruneCommand returns a new cobra prune command for networks
|
||||
func NewPruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
func NewPruneCommand(dockerCli command.Cli) *cobra.Command {
|
||||
opts := pruneOptions{filter: opts.NewFilterOpt()}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@ -47,7 +47,7 @@ func NewPruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
const warning = `WARNING! This will remove all networks not used by at least one container.
|
||||
Are you sure you want to continue?`
|
||||
|
||||
func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (output string, err error) {
|
||||
func runPrune(dockerCli command.Cli, opts pruneOptions) (output string, err error) {
|
||||
pruneFilters := command.PruneFilters(dockerCli, opts.filter.Value())
|
||||
|
||||
if !opts.force && !command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), warning) {
|
||||
@ -71,7 +71,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (output string, e
|
||||
|
||||
// RunPrune calls the Network Prune API
|
||||
// This returns the amount of space reclaimed and a detailed output string
|
||||
func RunPrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
||||
func RunPrune(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) {
|
||||
output, err := runPrune(dockerCli, pruneOptions{force: true, filter: filter})
|
||||
return 0, output, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user