From aec91f89a671872bd25d6a7e0ab6f10c98b9d834 Mon Sep 17 00:00:00 2001 From: Priyansu Rout Date: Tue, 11 Jun 2024 02:50:49 +0530 Subject: [PATCH] Replace ioutil.WriteFile with os.WriteFile Signed-off-by: Priyansu Rout --- common/deliverclient/blocksprovider/deliverer_test.go | 5 ++--- core/deliverservice/deliveryclient_test.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/deliverclient/blocksprovider/deliverer_test.go b/common/deliverclient/blocksprovider/deliverer_test.go index 238ec866c1e..9639746f9d3 100644 --- a/common/deliverclient/blocksprovider/deliverer_test.go +++ b/common/deliverclient/blocksprovider/deliverer_test.go @@ -8,7 +8,6 @@ package blocksprovider_test import ( "fmt" - "io/ioutil" "os" "path" "sync" @@ -832,7 +831,7 @@ func generateCertificatesSmartBFT(confAppSmartBFT *genesisconfig.Profile, tlsCA } srvP := path.Join(certDir, fmt.Sprintf("server%d.crt", i)) - err = ioutil.WriteFile(srvP, srvC.Cert, 0o644) + err = os.WriteFile(srvP, srvC.Cert, 0o644) if err != nil { return err } @@ -843,7 +842,7 @@ func generateCertificatesSmartBFT(confAppSmartBFT *genesisconfig.Profile, tlsCA } clnP := path.Join(certDir, fmt.Sprintf("client%d.crt", i)) - err = ioutil.WriteFile(clnP, clnC.Cert, 0o644) + err = os.WriteFile(clnP, clnC.Cert, 0o644) if err != nil { return err } diff --git a/core/deliverservice/deliveryclient_test.go b/core/deliverservice/deliveryclient_test.go index 08859ebcca9..e080a8a171d 100644 --- a/core/deliverservice/deliveryclient_test.go +++ b/core/deliverservice/deliveryclient_test.go @@ -8,7 +8,6 @@ package deliverservice import ( "fmt" - "io/ioutil" "os" "path" "testing" @@ -456,13 +455,13 @@ func generateCertificatesSmartBFT(t *testing.T, confAppSmartBFT *genesisconfig.P srvC, err := tlsCA.NewServerCertKeyPair(c.Host) require.NoError(t, err) srvP := path.Join(certDir, fmt.Sprintf("server%d.crt", i)) - err = ioutil.WriteFile(srvP, srvC.Cert, 0o644) + err = os.WriteFile(srvP, srvC.Cert, 0o644) require.NoError(t, err) clnC, err := tlsCA.NewClientCertKeyPair() require.NoError(t, err) clnP := path.Join(certDir, fmt.Sprintf("client%d.crt", i)) - err = ioutil.WriteFile(clnP, clnC.Cert, 0o644) + err = os.WriteFile(clnP, clnC.Cert, 0o644) require.NoError(t, err) c.Identity = srvP