Pārlūkot izejas kodu

Merge pull request #9928 from jfrazelle/cleanup-var

Cleanup unnecessary var.
Alexander Morozov 10 gadi atpakaļ
vecāks
revīzija
1aba2810a2
1 mainītis faili ar 2 papildinājumiem un 6 dzēšanām
  1. 2 6
      daemon/daemon.go

+ 2 - 6
daemon/daemon.go

@@ -151,12 +151,8 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
 // Get looks for a container by the specified ID or name, and returns it.
 // If the container is not found, or if an error occurs, nil is returned.
 func (daemon *Daemon) Get(name string) *Container {
-	var (
-		id  string
-		err error
-	)
-
-	if id, err = daemon.idIndex.Get(name); err == nil {
+	id, err := daemon.idIndex.Get(name)
+	if err == nil {
 		return daemon.containers.Get(id)
 	}