Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
godrei committed Oct 8, 2024
1 parent e33114d commit 118e1af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions xcodeproject/xcodeproj/appiconset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package xcodeproj

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -128,7 +127,7 @@ func Test_appIconSetPaths(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
projectDir, err := ioutil.TempDir("", "ios-dummy-project")
projectDir, err := os.MkdirTemp("", "ios-dummy-project")
if err != nil {
t.Errorf("setup: failed to create temp dir, %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions xcodeproject/xcodeproj/recreate_schemes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package xcodeproj

import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -35,7 +34,7 @@ func (p XcodeProj) SaveSharedScheme(scheme xcscheme.Scheme) error {
return fmt.Errorf("failed to create directory: %v", err)
}

if err := ioutil.WriteFile(path, contents, 0600); err != nil {
if err := os.WriteFile(path, contents, 0600); err != nil {
return fmt.Errorf("failed to write Scheme file (%s): %v", path, err)
}

Expand Down
6 changes: 3 additions & 3 deletions xcodeproject/xcodeproj/xcodeproj.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package xcodeproj
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -536,7 +536,7 @@ func (p XcodeProj) savePBXProj() error {
pth := path.Join(p.Path, "project.pbxproj")
newContent, merr := p.perObjectModify()
if merr == nil {
return ioutil.WriteFile(pth, newContent, 0644)
return os.WriteFile(pth, newContent, 0644)
}
// merr != nil
log.Warnf("failed to modify project in-place: %v", merr)
Expand All @@ -546,7 +546,7 @@ func (p XcodeProj) savePBXProj() error {
return fmt.Errorf("failed to marshal .pbxproj: %v", err)
}

return ioutil.WriteFile(pth, newContent, 0644)
return os.WriteFile(pth, newContent, 0644)
}

const (
Expand Down
3 changes: 1 addition & 2 deletions xcodeproject/xcscheme/xcscheme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package xcscheme

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

Expand All @@ -28,7 +27,7 @@ func Test_GivenScheme_WhenMarshal_ThenContentRemain(t *testing.T) {
_, err = f.Seek(0, io.SeekStart)
require.NoError(t, err)

schemeContent, err := ioutil.ReadAll(f)
schemeContent, err := io.ReadAll(f)
require.NoError(t, err)
require.Equal(t, string(schemeContent), string(content))
}
Expand Down

0 comments on commit 118e1af

Please sign in to comment.