Skip to content

Commit

Permalink
tor: use T.TempDir to create temporary test directory
Browse files Browse the repository at this point in the history
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
  • Loading branch information
Juneezee committed Aug 24, 2022
1 parent b5a626b commit ca1cc68
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tor/cmd_onion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tor
import (
"bytes"
"errors"
"io/ioutil"
"path/filepath"
"testing"

Expand All @@ -16,11 +15,8 @@ import (
func TestOnionFile(t *testing.T) {
t.Parallel()

tempDir, err := ioutil.TempDir("", "onion_store")
require.NoError(t, err, "unable to create temp dir")

privateKey := []byte("hide_me_plz")
privateKeyPath := filepath.Join(tempDir, "secret")
privateKeyPath := filepath.Join(t.TempDir(), "secret")

// Create a new file-based onion store. A private key should not exist
// yet.
Expand Down

0 comments on commit ca1cc68

Please sign in to comment.