diff --git a/api/types/versions/v1p24/types.go b/api/types/versions/v1p24/types.go index 8289d2c49a..470711335b 100644 --- a/api/types/versions/v1p24/types.go +++ b/api/types/versions/v1p24/types.go @@ -3,6 +3,7 @@ package v1p24 import "github.com/docker/docker/api/types" +// Info is a backcompatibility struct for the API 1.24 type Info struct { *types.InfoBase ExecutionDriver string diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index d82c2526f4..d4847a90ee 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -90,7 +90,7 @@ func noArgs(cmd *cobra.Command, args []string) error { return nil } return fmt.Errorf( - "docker: '%s' is not a docker command.\nSee 'docker --help'.", args[0]) + "docker: '%s' is not a docker command.\nSee 'docker --help'", args[0]) } func main() { diff --git a/daemon/cluster/cluster.go b/daemon/cluster/cluster.go index fe818f6747..55a74d8cb1 100644 --- a/daemon/cluster/cluster.go +++ b/daemon/cluster/cluster.go @@ -1052,10 +1052,9 @@ func (c *Cluster) imageWithDigestString(ctx context.Context, image string, authC return "", err } return namedDigestedRef.String(), nil - } else { - // reference already contains a digest, so just return it - return ref.String(), nil } + // reference already contains a digest, so just return it + return ref.String(), nil } // CreateService creates a new service in a managed swarm cluster. diff --git a/daemon/graphdriver/windows/windows.go b/daemon/graphdriver/windows/windows.go index 09ea6c7333..f050711c89 100644 --- a/daemon/graphdriver/windows/windows.go +++ b/daemon/graphdriver/windows/windows.go @@ -165,18 +165,16 @@ func (d *Driver) Exists(id string) bool { func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error { if opts != nil { return d.create(id, parent, opts.MountLabel, false, opts.StorageOpt) - } else { - return d.create(id, parent, "", false, nil) } + return d.create(id, parent, "", false, nil) } // Create creates a new read-only layer with the given id. func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { if opts != nil { return d.create(id, parent, opts.MountLabel, true, opts.StorageOpt) - } else { - return d.create(id, parent, "", true, nil) } + return d.create(id, parent, "", true, nil) } func (d *Driver) create(id, parent, mountLabel string, readOnly bool, storageOpt map[string]string) error { diff --git a/daemon/image_pull.go b/daemon/image_pull.go index 7dc1a2d0d9..4c866a61ff 100644 --- a/daemon/image_pull.go +++ b/daemon/image_pull.go @@ -106,6 +106,7 @@ func (daemon *Daemon) pullImageWithReference(ctx context.Context, ref reference. return err } +// GetRepository returns a repository from the registry. func (daemon *Daemon) GetRepository(ctx context.Context, ref reference.NamedTagged, authConfig *types.AuthConfig) (dist.Repository, bool, error) { // get repository info repoInfo, err := daemon.RegistryService.ResolveRepository(ref) diff --git a/daemon/info_unix.go b/daemon/info_unix.go index fd2d1a1c57..00e3414936 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -13,6 +13,7 @@ import ( "github.com/docker/docker/pkg/sysinfo" ) +// FillPlatformInfo fills the platform related info. func (daemon *Daemon) FillPlatformInfo(v *types.InfoBase, sysInfo *sysinfo.SysInfo) { v.MemoryLimit = sysInfo.MemoryLimit v.SwapLimit = sysInfo.SwapLimit diff --git a/daemon/info_windows.go b/daemon/info_windows.go index 783062e89b..84305240ec 100644 --- a/daemon/info_windows.go +++ b/daemon/info_windows.go @@ -5,5 +5,6 @@ import ( "github.com/docker/docker/pkg/sysinfo" ) +// FillPlatformInfo fills the platform related info. func (daemon *Daemon) FillPlatformInfo(v *types.InfoBase, sysInfo *sysinfo.SysInfo) { } diff --git a/integration-cli/docker_cli_help_test.go b/integration-cli/docker_cli_help_test.go index 415974355e..29b6553fc5 100644 --- a/integration-cli/docker_cli_help_test.go +++ b/integration-cli/docker_cli_help_test.go @@ -196,7 +196,7 @@ func (s *DockerSuite) TestHelpExitCodesHelpOutput(c *check.C) { stdout, stderr, _, err = runCommandWithStdoutStderr(cmd) c.Assert(err, checker.NotNil) c.Assert(stdout, checker.Equals, "") - c.Assert(stderr, checker.Equals, "docker: 'BadCmd' is not a docker command.\nSee 'docker --help'.\n", check.Commentf("Unexcepted output for 'docker badCmd'\n")) + c.Assert(stderr, checker.Equals, "docker: 'BadCmd' is not a docker command.\nSee 'docker --help'\n", check.Commentf("Unexcepted output for 'docker badCmd'\n")) } func testCommand(cmd string, newEnvs []string, scanForHome bool, home string) error { diff --git a/opts/port.go b/opts/port.go index ef3f12a465..d337cb1a43 100644 --- a/opts/port.go +++ b/opts/port.go @@ -16,6 +16,7 @@ const ( portOptMode = "mode" ) +// PortOpt represents a port config in swarm mode. type PortOpt struct { ports []swarm.PortConfig } diff --git a/pkg/devicemapper/devmapper_wrapper_no_deferred_remove.go b/pkg/devicemapper/devmapper_wrapper_no_deferred_remove.go index 4a6665de86..8249ccf854 100644 --- a/pkg/devicemapper/devmapper_wrapper_no_deferred_remove.go +++ b/pkg/devicemapper/devmapper_wrapper_no_deferred_remove.go @@ -2,7 +2,7 @@ package devicemapper -// LibraryDeferredRemovalsupport is not supported when statically linked. +// LibraryDeferredRemovalSupport is not supported when statically linked. const LibraryDeferredRemovalSupport = false func dmTaskDeferredRemoveFct(task *cdmTask) int { diff --git a/plugin/backend_unsupported.go b/plugin/backend_unsupported.go index cd3cf80d3b..2e9ca5b320 100644 --- a/plugin/backend_unsupported.go +++ b/plugin/backend_unsupported.go @@ -11,50 +11,50 @@ import ( "golang.org/x/net/context" ) -var ErrNotSupported = errors.New("plugins are not supported on this platform") +var errNotSupported = errors.New("plugins are not supported on this platform") // Disable deactivates a plugin, which implies that they cannot be used by containers. func (pm *Manager) Disable(name string) error { - return ErrNotSupported + return errNotSupported } // Enable activates a plugin, which implies that they are ready to be used by containers. func (pm *Manager) Enable(name string) error { - return ErrNotSupported + return errNotSupported } // Inspect examines a plugin config func (pm *Manager) Inspect(name string) (tp types.Plugin, err error) { - return tp, ErrNotSupported + return tp, errNotSupported } // Pull pulls a plugin and computes the privileges required to install it. func (pm *Manager) Pull(name string, metaHeader http.Header, authConfig *types.AuthConfig) (types.PluginPrivileges, error) { - return nil, ErrNotSupported + return nil, errNotSupported } // List displays the list of plugins and associated metadata. func (pm *Manager) List() ([]types.Plugin, error) { - return nil, ErrNotSupported + return nil, errNotSupported } // Push pushes a plugin to the store. func (pm *Manager) Push(name string, metaHeader http.Header, authConfig *types.AuthConfig) error { - return ErrNotSupported + return errNotSupported } // Remove deletes plugin's root directory. func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error { - return ErrNotSupported + return errNotSupported } // Set sets plugin args func (pm *Manager) Set(name string, args []string) error { - return ErrNotSupported + return errNotSupported } // CreateFromContext creates a plugin from the given pluginDir which contains // both the rootfs and the config.json and a repoName with optional tag. func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.Reader, options *types.PluginCreateOptions) error { - return ErrNotSupported + return errNotSupported } diff --git a/volume/local/local.go b/volume/local/local.go index be259d1501..18ddca54d5 100644 --- a/volume/local/local.go +++ b/volume/local/local.go @@ -269,7 +269,7 @@ func (r *Root) validateName(name string) error { return validationError{fmt.Errorf("volume name is too short, names should be at least two alphanumeric characters")} } if !volumeNameRegex.MatchString(name) { - return validationError{fmt.Errorf("%q includes invalid characters for a local volume name, only %q are allowed. If you intented to pass a host directory, use absolute path.", name, utils.RestrictedNameChars)} + return validationError{fmt.Errorf("%q includes invalid characters for a local volume name, only %q are allowed. If you intented to pass a host directory, use absolute path", name, utils.RestrictedNameChars)} } return nil }