Skip to content

Commit

Permalink
hk: deprecated ioutil temp dir -> os mk temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmCherry committed May 2, 2024
1 parent 821855d commit 17a497b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package accord
import (
"context"
"io"
"io/ioutil"
"os"
"time"

"github.com/bsm/accord/internal/cache"
Expand Down Expand Up @@ -74,7 +74,7 @@ type Client struct {
func RPCClient(ctx context.Context, rpc rpc.V1Client, opt *ClientOptions) (*Client, error) {
opt = opt.norm()

cacheDir, err := ioutil.TempDir(opt.Dir, "accord-client-cache")
cacheDir, err := os.MkdirTemp(opt.Dir, "accord-client-cache")
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package accord_test

import (
"context"
"io/ioutil"
"os"
"time"

Expand All @@ -22,7 +21,7 @@ var _ = Describe("Client", func() {

BeforeEach(func() {
var err error
tempDir, err = ioutil.TempDir("", "accord-client-test")
tempDir, err = os.MkdirTemp("", "accord-client-test")
Expect(err).NotTo(HaveOccurred())

backend = mock.New()
Expand Down
3 changes: 1 addition & 2 deletions internal/cache/badger_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cache_test

import (
"io/ioutil"
"os"

"github.com/bsm/accord/internal/cache"
Expand All @@ -15,7 +14,7 @@ var _ = Describe("Badger", func() {

BeforeEach(func() {
var err error
tempDir, err = ioutil.TempDir("", "accord-cache-test")
tempDir, err = os.MkdirTemp("", "accord-cache-test")
Expect(err).NotTo(HaveOccurred())

subject, err = cache.OpenBadger(tempDir)
Expand Down

0 comments on commit 17a497b

Please sign in to comment.