From 4d42d79e920a895490c28e0e584c22f72a2ba677 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 20 Mar 2024 22:21:25 -0700 Subject: [PATCH] empty array for hosts (#40) --- pkg/actions/setup.go | 3 +-- pkg/actions/upload.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/actions/setup.go b/pkg/actions/setup.go index 5620439..01f3a21 100644 --- a/pkg/actions/setup.go +++ b/pkg/actions/setup.go @@ -13,7 +13,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "mime/multipart" "net/http" "net/url" @@ -311,7 +310,7 @@ func existingAccountSetup(serverUrl *url.URL) error { return err } defer f.Close() - pubkey, err := ioutil.ReadAll(f) + pubkey, err := io.ReadAll(f) if err != nil { return err } diff --git a/pkg/actions/upload.go b/pkg/actions/upload.go index 4b7a1d1..18f3281 100644 --- a/pkg/actions/upload.go +++ b/pkg/actions/upload.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "mime/multipart" "net/http" "os" @@ -68,7 +67,7 @@ func Upload(c *cli.Context) error { if err != nil { return err } - var hosts []models.Host + hosts := []models.Host{} for _, file := range data { if file.IsDir() || file.Name() == "authorized_keys" { continue @@ -84,7 +83,7 @@ func Upload(c *cli.Context) error { return err } // read file into buffer - data, err := ioutil.ReadAll(f) + data, err := io.ReadAll(f) if err != nil { return err }