diff --git a/nsinit/main.go b/nsinit/cli.go similarity index 94% rename from nsinit/main.go rename to nsinit/cli.go index 90c4a901..d4235aef 100644 --- a/nsinit/main.go +++ b/nsinit/cli.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "log" @@ -19,7 +19,7 @@ func preload(context *cli.Context) error { return nil } -func main() { +func NsInit() { app := cli.NewApp() app.Name = "nsinit" app.Version = "0.1" diff --git a/nsinit/config.go b/nsinit/config.go index e1f28fcc..5beb04ac 100644 --- a/nsinit/config.go +++ b/nsinit/config.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "encoding/json" diff --git a/nsinit/exec.go b/nsinit/exec.go index c58c3066..eb734545 100644 --- a/nsinit/exec.go +++ b/nsinit/exec.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "fmt" diff --git a/nsinit/init.go b/nsinit/init.go index eedb9610..5b153455 100644 --- a/nsinit/init.go +++ b/nsinit/init.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "log" diff --git a/nsinit/main/nsinit.go b/nsinit/main/nsinit.go new file mode 100644 index 00000000..816c4da5 --- /dev/null +++ b/nsinit/main/nsinit.go @@ -0,0 +1,7 @@ +package main + +import "github.com/docker/libcontainer/nsinit" + +func main() { + nsinit.NsInit() +} diff --git a/nsinit/nsenter.go b/nsinit/nsenter.go index faa61315..d3df4f66 100644 --- a/nsinit/nsenter.go +++ b/nsinit/nsenter.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "log" diff --git a/nsinit/pause.go b/nsinit/pause.go index 6744539c..492a0e85 100644 --- a/nsinit/pause.go +++ b/nsinit/pause.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "log" diff --git a/nsinit/stats.go b/nsinit/stats.go index 331d27f2..3e59305b 100644 --- a/nsinit/stats.go +++ b/nsinit/stats.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "encoding/json" diff --git a/nsinit/utils.go b/nsinit/utils.go index 44194d88..8525ba9a 100644 --- a/nsinit/utils.go +++ b/nsinit/utils.go @@ -1,4 +1,4 @@ -package main +package nsinit import ( "encoding/json"