mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 00:18:28 +00:00
refactor: move from io/ioutil to io and os package (#1843)
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -15,7 +15,6 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
@@ -837,12 +836,12 @@ func setupWithDefaults(flags map[string]interface{}, t *testing.T) *cobra.Comman
|
||||
}
|
||||
|
||||
func tempFile(t *testing.T, contents string) string {
|
||||
f, err := ioutil.TempFile("", "")
|
||||
f, err := os.CreateTemp("", "")
|
||||
Ok(t, err)
|
||||
newName := f.Name() + ".yaml"
|
||||
err = os.Rename(f.Name(), newName)
|
||||
Ok(t, err)
|
||||
ioutil.WriteFile(newName, []byte(contents), 0600) // nolint: errcheck
|
||||
os.WriteFile(newName, []byte(contents), 0600) // nolint: errcheck
|
||||
return newName
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user