cleanup: use os.WriteFile to write files

as ioutil.WriteFile is deprecated and
suggestion is to use os.WriteFile as
per https://pkg.go.dev/io/ioutil updating
the same.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-01-21 14:58:27 +05:30
committed by mergify[bot]
parent 15ed9709d4
commit 562dff0d19
6 changed files with 17 additions and 20 deletions

View File

@ -17,7 +17,6 @@ limitations under the License.
package util
import (
"io/ioutil"
"os"
)
@ -57,7 +56,7 @@ func WriteCephConfig() error {
// create config file if it does not exist to support backward compatibility
if _, err = os.Stat(CephConfigPath); os.IsNotExist(err) {
err = ioutil.WriteFile(CephConfigPath, cephConfig, 0o600)
err = os.WriteFile(CephConfigPath, cephConfig, 0o600)
}
if err != nil {