Ver código fonte

use init function

Victor Vieux 12 anos atrás
pai
commit
740a97f1a8
2 arquivos alterados com 2 adições e 10 exclusões
  1. 0 10
      a_test.go
  2. 2 0
      runtime_test.go

+ 0 - 10
a_test.go

@@ -1,10 +0,0 @@
-package docker
-
-import (
-	"os"
-	"testing"
-)
-
-func Test(t *testing.T) {
-	os.Setenv("TEST", "1")
-}

+ 2 - 0
runtime_test.go

@@ -72,6 +72,8 @@ func layerArchive(tarfile string) (io.Reader, error) {
 }
 
 func init() {
+	os.Setenv("TEST", "1")
+
 	// Hack to run sys init during unit testing
 	if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
 		SysInit()