Skip to content

Commit

Permalink
chore: remove refs to deprecated io/ioutil
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
testwill committed May 15, 2024
1 parent a7f8963 commit a3a67ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/speaker/bgp/bgp/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package bgp

import (
"context"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -102,11 +101,11 @@ func (b *Bgp) assignGlobalpolicy(ctx context.Context, bgpServer *server.BgpServe

func writeToTempFile(val string) (string, error) {
var path string
temp, err := ioutil.TempFile(os.TempDir(), "temp")
temp, err := os.CreateTemp(os.TempDir(), "temp")
if err != nil {
return path, err
}
err = ioutil.WriteFile(temp.Name(), []byte(val), 0644)
err = os.WriteFile(temp.Name(), []byte(val), 0644)
if err != nil {
return path, err
}
Expand Down

0 comments on commit a3a67ab

Please sign in to comment.