diff --git a/internal/api/v1/template.go b/internal/api/v1/template.go index 61e843bfd..41543e448 100644 --- a/internal/api/v1/template.go +++ b/internal/api/v1/template.go @@ -127,7 +127,6 @@ import ( "compress/gzip" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -3013,7 +3012,7 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + err = os.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } diff --git a/internal/config/load.go b/internal/config/load.go index e9e22f39c..e39ced17d 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "log" "net/http" "os" @@ -46,7 +45,7 @@ func loadConfigFromFile(path string) (*Config, error) { return nil, fmt.Errorf("no such file %s", filename) } - yamlFile, err := ioutil.ReadFile(filename) + yamlFile, err := os.ReadFile(filename) if err != nil { return nil, err } @@ -436,7 +435,7 @@ func Load(configPath string, telemetry bool, analytics utils.Analytics, db *bun. accounts = append(accounts, cloudAccount) - data, err := ioutil.ReadFile(account.ServiceAccountKeyPath) + data, err := os.ReadFile(account.ServiceAccountKeyPath) if err != nil { log.Fatal(err) } diff --git a/providers/gcp/compute/instances_test.go b/providers/gcp/compute/instances_test.go index 4cb406dd7..c00192dc4 100644 --- a/providers/gcp/compute/instances_test.go +++ b/providers/gcp/compute/instances_test.go @@ -3,7 +3,7 @@ package compute import ( "context" "fmt" - "io/ioutil" + "os" "testing" "github.com/tailwarden/komiser/providers" @@ -13,7 +13,7 @@ import ( func TestInstances(t *testing.T) { t.Skip("Only for local development because it is using a Google Cloud connection") // Replace the empty string with a SA or credentials file location - data, err := ioutil.ReadFile("") + data, err := os.ReadFile("") if err != nil { t.Fatal(err) }