Update gometalinter
and enable the new WarnUnmatchedDirective to warn if a nolint is unnecessary. remove some unnecessary nolint Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
@ -7,8 +7,7 @@ import (
|
||||
)
|
||||
|
||||
// NewSystemCommand returns a cobra command for `system` subcommands
|
||||
// nolint: interfacer
|
||||
func NewSystemCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
func NewSystemCommand(dockerCli command.Cli) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "system",
|
||||
Short: "Manage Docker",
|
||||
|
||||
@ -16,7 +16,7 @@ type diskUsageOptions struct {
|
||||
}
|
||||
|
||||
// newDiskUsageCommand creates a new cobra.Command for `docker df`
|
||||
func newDiskUsageCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
func newDiskUsageCommand(dockerCli command.Cli) *cobra.Command {
|
||||
var opts diskUsageOptions
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@ -37,7 +37,7 @@ func newDiskUsageCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runDiskUsage(dockerCli *command.DockerCli, opts diskUsageOptions) error {
|
||||
func runDiskUsage(dockerCli command.Cli, opts diskUsageOptions) error {
|
||||
if opts.verbose && len(opts.format) != 0 {
|
||||
return errors.New("the verbose and the format options conflict")
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ type eventsOptions struct {
|
||||
}
|
||||
|
||||
// NewEventsCommand creates a new cobra.Command for `docker events`
|
||||
func NewEventsCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
func NewEventsCommand(dockerCli command.Cli) *cobra.Command {
|
||||
options := eventsOptions{filter: opts.NewFilterOpt()}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@ -48,7 +48,7 @@ func NewEventsCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runEvents(dockerCli *command.DockerCli, options *eventsOptions) error {
|
||||
func runEvents(dockerCli command.Cli, options *eventsOptions) error {
|
||||
tmpl, err := makeTemplate(options.format)
|
||||
if err != nil {
|
||||
return cli.StatusError{
|
||||
|
||||
@ -22,7 +22,7 @@ type infoOptions struct {
|
||||
}
|
||||
|
||||
// NewInfoCommand creates a new cobra.Command for `docker info`
|
||||
func NewInfoCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
func NewInfoCommand(dockerCli command.Cli) *cobra.Command {
|
||||
var opts infoOptions
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@ -41,7 +41,7 @@ func NewInfoCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runInfo(dockerCli *command.DockerCli, opts *infoOptions) error {
|
||||
func runInfo(dockerCli command.Cli, opts *infoOptions) error {
|
||||
ctx := context.Background()
|
||||
info, err := dockerCli.Client().Info(ctx)
|
||||
if err != nil {
|
||||
@ -357,7 +357,7 @@ func getBackingFs(info types.Info) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func formatInfo(dockerCli *command.DockerCli, info types.Info, format string) error {
|
||||
func formatInfo(dockerCli command.Cli, info types.Info, format string) error {
|
||||
tmpl, err := templates.Parse(format)
|
||||
if err != nil {
|
||||
return cli.StatusError{StatusCode: 64,
|
||||
|
||||
Reference in New Issue
Block a user