fix(init): bad variable name and missing package (#78)

This commit is contained in:
Andrew Rynhard 2018-05-11 15:00:13 -07:00 committed by GitHub
parent e18cf83a8e
commit 7c37272dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,11 +13,12 @@ import (
"github.com/autonomy/dianemo/initramfs/cmd/init/pkg/mount"
"github.com/autonomy/dianemo/initramfs/cmd/init/pkg/rootfs"
"github.com/autonomy/dianemo/initramfs/cmd/init/pkg/service"
"github.com/autonomy/dianemo/initramfs/cmd/init/pkg/switchroot"
"github.com/autonomy/dianemo/initramfs/cmd/init/pkg/userdata"
)
var (
switchroot *bool
switchRoot *bool
)
func hang() {
@ -37,7 +38,7 @@ func init() {
panic(err)
}
switchroot = flag.Bool("switch-root", false, "perform a switch_root")
switchRoot = flag.Bool("switch-root", false, "perform a switch_root")
flag.Parse()
}
@ -99,7 +100,7 @@ func root() (err error) {
func main() {
defer hang()
if *switchroot {
if *switchRoot {
if err := root(); err != nil {
panic(err)
}