Skip to content

Commit

Permalink
freeze: remove deprecated import
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed May 27, 2024
1 parent ebe16b6 commit 2ae97a2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions freeze.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -25,7 +24,7 @@ func UnfreezeFilterConfig(frozenfile string) (dir, blob string, err error) {
mappings = make(map[string]string)
b []byte
)
if dir, err = ioutil.TempDir("", "span-tag-unfreeze-"); err != nil {
if dir, err = os.MkdirTemp("", "span-tag-unfreeze-"); err != nil {
return
}
if r, err = zip.OpenReader(frozenfile); err != nil {
Expand Down Expand Up @@ -66,7 +65,7 @@ func UnfreezeFilterConfig(frozenfile string) (dir, blob string, err error) {
}
}
blob = filepath.Join(dir, "blob")
if b, err = ioutil.ReadFile(blob); err != nil {
if b, err = os.ReadFile(blob); err != nil {
return
}
for url, file := range mappings {
Expand All @@ -75,7 +74,7 @@ func UnfreezeFilterConfig(frozenfile string) (dir, blob string, err error) {
replacement := []byte(fmt.Sprintf(`"file://%s"`, filepath.Join(dir, file)))
b = bytes.Replace(b, value, replacement, -1)
}
if err = ioutil.WriteFile(blob, b, 0777); err != nil {
if err = os.WriteFile(blob, b, 0777); err != nil {
return
}
return dir, blob, nil
Expand Down

0 comments on commit 2ae97a2

Please sign in to comment.