Skip to content

Commit

Permalink
fix: fix ci error in errorcheck.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <[email protected]>
  • Loading branch information
Electronic-Waste committed Mar 12, 2024
1 parent 2496e94 commit 82c248f
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ const (
)

var (
testJsonDataPath = filepath.Join("testdata", "JSON")
testTextDataPath = filepath.Join("testdata", "TEXT")
testDir = "testdata"
testJsonDataPath = filepath.Join(testDir, "JSON")
testTextDataPath = filepath.Join(testDir, "TEXT")
)

func TestCollectObservationLog(t *testing.T) {
Expand All @@ -56,7 +57,7 @@ func TestCollectObservationLog(t *testing.T) {
if err := generateTEXTTestFiles(); err != nil {
t.Fatal(err)
}
defer deleteTestDirs()
defer os.RemoveAll(testDir)

testCases := map[string]struct {
filePath string
Expand Down Expand Up @@ -337,18 +338,6 @@ func generateTestDirs() error {
return nil
}

func deleteTestDirs() error {
if err := os.RemoveAll(filepath.Dir(testJsonDataPath)); err != nil {
return err
}

if err := os.RemoveAll(filepath.Dir(testTextDataPath)); err != nil {
return err
}

return nil
}

func generateJSONTestFiles() error {
testData := []struct {
fileName string
Expand Down

0 comments on commit 82c248f

Please sign in to comment.