Skip to content

Commit cf44ded

Browse files
committed
*: ioutil.WriteFile -> os.WriteFile
ioutil.WriteFile was changed to only call os.WriteFile so lets appease the linter
1 parent 46ea650 commit cf44ded

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/awsorgs/organization.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ func (c Client) DelegateAdmin(ctx context.Context, acctID, servicePrincipal stri
454454

455455
// FetchDelegatedAdminPrincipals returns a list of accounts that have delegated
456456
// admin permissions and the service principals with a key of account ID and
457-
// value of service principals.
457+
// value with a slice of service principals that are delegated to the account key.
458458
func (c Client) FetchDelegatedAdminPrincipals(ctx context.Context) (map[string][]string, error) {
459459
var delegatedAccounts []string
460460
err := c.organizationClient.ListDelegatedAdministratorsPagesWithContext(ctx, &organizations.ListDelegatedAdministratorsInput{},

lib/terraform/local.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ func replaceVariablesInFile(srcFile, dstFile string, resource resource.Resource,
8181
return oops.Errorf("Region needs to be set on stack if performing substitution")
8282
}
8383

84-
return ioutil.WriteFile(dstFile, []byte(updatedContent), fileInfo.Mode())
84+
return os.WriteFile(dstFile, []byte(updatedContent), fileInfo.Mode())
8585
}

lib/ymlparser/organization.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func WriteOrgFile(filepath string, org *resource.OrganizationUnit) error {
222222
return fmt.Errorf("file %s already exists we will not overwrite it", filepath)
223223
}
224224

225-
if err := ioutil.WriteFile(filepath, result, 0644); err != nil {
225+
if err := os.WriteFile(filepath, result, 0644); err != nil {
226226
return err
227227
}
228228

tests/end2end_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package tests
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
6+
"os"
77
"runtime/debug"
88
"testing"
99

@@ -1071,7 +1071,7 @@ func TestEndToEnd(t *testing.T) {
10711071
compareOrganizationUnits(t, test.OrgInitialState, &fetchedOrg, true)
10721072
}
10731073

1074-
err = ioutil.WriteFile("organization.yml", []byte(test.OrgYaml), 0644)
1074+
err = os.WriteFile("organization.yml", []byte(test.OrgYaml), 0644)
10751075
assert.NoError(t, err, "Failed to write organization.yml")
10761076

10771077
parsedOrg, err := ymlparser.NewParser(orgClient).ParseOrganization(ctx, "organization.yml")

0 commit comments

Comments
 (0)