Skip to content

Commit

Permalink
Merge pull request tailwarden#1051 from shubhindia/chore/drop-depreca…
Browse files Browse the repository at this point in the history
…ted-ioutil

chore: drop deprecated ioutil
  • Loading branch information
mlabouardy authored Oct 9, 2023
2 parents 52d7ea0 + ebc8de4 commit 0c8eda2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions internal/api/v1/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ import (
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -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
}
Expand Down
5 changes: 2 additions & 3 deletions internal/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions providers/gcp/compute/instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"os"
"testing"

"github.com/tailwarden/komiser/providers"
Expand All @@ -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)
}
Expand Down

0 comments on commit 0c8eda2

Please sign in to comment.