Skip to content

Commit

Permalink
Use io instead of ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode committed Nov 17, 2022
1 parent 4be4987 commit 6edaef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions server/events/project_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package events

import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -75,7 +74,7 @@ var cloudBlockSchema = &hcl.BodySchema{

func (p *DefaultProjectFinder) DetermineWorkspaceFromHCL(log logging.SimpleLogging, absRepoDir string) (string, error) {
log.Info("looking for Terraform Cloud workspace from configuration in %q", absRepoDir)
infos, err := ioutil.ReadDir(absRepoDir)
infos, err := os.ReadDir(absRepoDir)
if err != nil {
return "", err
}
Expand Down
7 changes: 4 additions & 3 deletions server/events/repo_branch_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package events

import (
"io/ioutil"
"io"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -64,7 +65,7 @@ projects:
tmp := t.TempDir()

globalYAMLPath := filepath.Join(tmp, "config.yaml")
err := ioutil.WriteFile(globalYAMLPath, []byte(globalYAML), 0600)
err := os.WriteFile(globalYAMLPath, []byte(globalYAML), 0600)
require.NoError(t, err)

globalCfgArgs := valid.GlobalCfgArgs{
Expand All @@ -79,7 +80,7 @@ projects:
require.NoError(t, err)

repoYAMLPath := filepath.Join(tmp, "atlantis.yaml")
err = ioutil.WriteFile(repoYAMLPath, []byte(repoYAML), 0600)
err = io.WriteFile(repoYAMLPath, []byte(repoYAML), 0600)
require.NoError(t, err)

repo, err := parser.ParseRepoCfg(tmp, global, "github.com/foo/bar", "main")
Expand Down

0 comments on commit 6edaef3

Please sign in to comment.